Class IdTokenResponse
Beta OAuth ID Connect JSON model for a successful access token response as specified in OpenID Connect Basic Client Profile 1.0 (draft 23).
Implementation is not thread-safe. Sample usage:
static JsonWebSignature executeIdToken(TokenRequest tokenRequest) throws IOException {
IdTokenResponse idTokenResponse = IdTokenResponse.execute(tokenRequest);
return idTokenResponse.parseIdToken();
}
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.FlagsNested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()static IdTokenResponseexecute(TokenRequest tokenRequest) Executes the given ID token request, and returns the parsed ID token response.final StringReturns the ID token.setAccessToken(String accessToken) Sets the access token issued by the authorization server.setExpiresInSeconds(Long expiresIn) Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.setIdToken(String idToken) Sets the ID token.setRefreshToken(String refreshToken) Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Sets the scope of the access token ornullfor none.setTokenType(String tokenType) Sets the token type (as specified in Access Token Types).Methods inherited from class com.google.api.client.auth.oauth2.TokenResponse
getAccessToken, getExpiresInSeconds, getRefreshToken, getScope, getTokenTypeMethods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toStringMethods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeysMethods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, valuesMethods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, waitMethods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
idToken
ID token.
-
-
Constructor Details
-
IdTokenResponse
public IdTokenResponse()
-
-
Method Details
-
getIdToken
Returns the ID token. -
setIdToken
Sets the ID token.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
setAccessToken
Description copied from class:TokenResponseSets the access token issued by the authorization server.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setAccessTokenin classTokenResponse
-
setTokenType
Description copied from class:TokenResponseSets the token type (as specified in Access Token Types).Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setTokenTypein classTokenResponse
-
setExpiresInSeconds
Description copied from class:TokenResponseSets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setExpiresInSecondsin classTokenResponse
-
setRefreshToken
Description copied from class:TokenResponseSets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setRefreshTokenin classTokenResponse
-
setScope
Description copied from class:TokenResponseSets the scope of the access token ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setScopein classTokenResponse
-
parseIdToken
- Throws:
IOException
-
execute
Executes the given ID token request, and returns the parsed ID token response.- Parameters:
tokenRequest- token request- Returns:
- parsed successful ID token response
- Throws:
TokenResponseException- for an error responseIOException
-
set
- Overrides:
setin classTokenResponse
-
clone
- Overrides:
clonein classTokenResponse
-