Class IdTokenResponse
- java.lang.Object
-
- java.util.AbstractMap<java.lang.String,java.lang.Object>
-
- com.google.api.client.util.GenericData
-
- com.google.api.client.json.GenericJson
-
- com.google.api.client.auth.oauth2.TokenResponse
-
- com.google.api.client.auth.openidconnect.IdTokenResponse
-
- All Implemented Interfaces:
java.lang.Cloneable
,java.util.Map<java.lang.String,java.lang.Object>
@Beta public class IdTokenResponse extends TokenResponse
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
-
-
Field Summary
Fields Modifier and Type Field Description private java.lang.String
idToken
ID token.
-
Constructor Summary
Constructors Constructor Description IdTokenResponse()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description IdTokenResponse
clone()
static IdTokenResponse
execute(TokenRequest tokenRequest)
Executes the given ID token request, and returns the parsed ID token response.java.lang.String
getIdToken()
Returns the ID token.IdToken
parseIdToken()
IdTokenResponse
set(java.lang.String fieldName, java.lang.Object value)
IdTokenResponse
setAccessToken(java.lang.String accessToken)
Sets the access token issued by the authorization server.IdTokenResponse
setExpiresInSeconds(java.lang.Long expiresIn)
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornull
for none.IdTokenResponse
setIdToken(java.lang.String idToken)
Sets the ID token.IdTokenResponse
setRefreshToken(java.lang.String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornull
for none.IdTokenResponse
setScope(java.lang.String scope)
Sets the scope of the access token ornull
for none.IdTokenResponse
setTokenType(java.lang.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
-
-
-
-
Method Detail
-
getIdToken
public final java.lang.String getIdToken()
Returns the ID token.
-
setIdToken
public IdTokenResponse setIdToken(java.lang.String idToken)
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
public IdTokenResponse setAccessToken(java.lang.String accessToken)
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
public IdTokenResponse setTokenType(java.lang.String tokenType)
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
public IdTokenResponse setExpiresInSeconds(java.lang.Long expiresIn)
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
public IdTokenResponse setRefreshToken(java.lang.String refreshToken)
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
public IdTokenResponse setScope(java.lang.String scope)
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
public IdToken parseIdToken() throws java.io.IOException
- Throws:
java.io.IOException
-
execute
public static IdTokenResponse execute(TokenRequest tokenRequest) throws java.io.IOException
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 responsejava.io.IOException
-
set
public IdTokenResponse set(java.lang.String fieldName, java.lang.Object value)
- Overrides:
set
in classTokenResponse
-
clone
public IdTokenResponse clone()
- Overrides:
clone
in classTokenResponse
-
-