public class GoogleTokenResponse
extends com.google.api.client.auth.openidconnect.IdTokenResponse
This response object is the result of GoogleAuthorizationCodeTokenRequest.execute()
and
GoogleRefreshTokenRequest.execute()
. Use parseIdToken()
to parse the
GoogleIdToken
and then call GoogleIdToken.verify(GoogleIdTokenVerifier)
to verify
it (or just call verifyIdToken(GoogleIdTokenVerifier)
).
Implementation is not thread-safe.
com.google.api.client.util.GenericData.Flags
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
Constructor and Description |
---|
GoogleTokenResponse() |
Modifier and Type | Method and Description |
---|---|
GoogleIdToken |
parseIdToken() |
GoogleTokenResponse |
setAccessToken(String accessToken) |
GoogleTokenResponse |
setExpiresInSeconds(Long expiresIn) |
GoogleTokenResponse |
setIdToken(String idToken) |
GoogleTokenResponse |
setRefreshToken(String refreshToken) |
GoogleTokenResponse |
setScope(String scope) |
GoogleTokenResponse |
setTokenType(String tokenType) |
boolean |
verifyIdToken(GoogleIdTokenVerifier verifier)
Verifies the ID token as specified in
GoogleIdTokenVerifier.verify(com.google.api.client.googleapis.auth.oauth2.GoogleIdToken) by passing it
parseIdToken() . |
execute, getIdToken
getAccessToken, getExpiresInSeconds, getRefreshToken, getScope, getTokenType
clone, getFactory, setFactory, toPrettyString, toString
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, set, setUnknownKeys
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
public GoogleTokenResponse setIdToken(String idToken)
setIdToken
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleTokenResponse setAccessToken(String accessToken)
setAccessToken
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleTokenResponse setTokenType(String tokenType)
setTokenType
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleTokenResponse setExpiresInSeconds(Long expiresIn)
setExpiresInSeconds
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleTokenResponse setRefreshToken(String refreshToken)
setRefreshToken
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleTokenResponse setScope(String scope)
setScope
in class com.google.api.client.auth.openidconnect.IdTokenResponse
public GoogleIdToken parseIdToken() throws IOException
parseIdToken
in class com.google.api.client.auth.openidconnect.IdTokenResponse
IOException
public boolean verifyIdToken(GoogleIdTokenVerifier verifier) throws GeneralSecurityException, IOException
GoogleIdTokenVerifier.verify(com.google.api.client.googleapis.auth.oauth2.GoogleIdToken)
by passing it
parseIdToken()
.verifier
- Google ID token verifierGeneralSecurityException
IOException
Copyright © 2010-2013 Google. All Rights Reserved.