你好任何人都可以帮助我吗?
public static GoogleIdToken.Payload getPayload(String tokenString) 抛出异常{
JacksonFactory jacksonFactory = new JacksonFactory(); GoogleIdTokenVerifier googleIdTokenVerifier = new GoogleIdTokenVerifier(new NetHttpTransport(),jacksonFactory); GoogleIdToken token = GoogleIdToken.parse(jacksonFactory, tokenString); System.out.println(token); if (googleIdTokenVerifier.verify(token)) { GoogleIdToken.Payload payload = token.getPayload(); if (!GOOGLE_CLIENT_ID.equals(payload.getAudience())) { throw new IllegalArgumentException("Audience mismatch"); } else if (!GOOGLE_CLIENT_ID.equals(payload.getAuthorizedParty())) { throw new IllegalArgumentException("Client ID mismatch"); } return payload; } else { throw new IllegalArgumentException("id token cannot be verified"); } }
GoogleIdTokenVerifier.verify()方法返回false。但令牌是他们的。 请求帮助我.................................