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.Flags
Nested 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 IdTokenResponse
execute
(TokenRequest tokenRequest) Executes the given ID token request, and returns the parsed ID token response.final String
Returns 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) ornull
for 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 ornull
for none.Sets the scope of the access token ornull
for 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, getTokenType
Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toString
Methods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeys
Methods inherited from class java.util.AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, values
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods 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:TokenResponse
Sets 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:
setAccessToken
in classTokenResponse
-
setTokenType
Description copied from class:TokenResponse
Sets 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:
setTokenType
in classTokenResponse
-
setExpiresInSeconds
Description copied from class:TokenResponse
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setExpiresInSeconds
in classTokenResponse
-
setRefreshToken
Description copied from class:TokenResponse
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setRefreshToken
in classTokenResponse
-
setScope
Description copied from class:TokenResponse
Sets the scope of the access token ornull
for none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
- Overrides:
setScope
in 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:
set
in classTokenResponse
-
clone
- Overrides:
clone
in classTokenResponse
-