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(); }
Inheritance
Object > java.util.AbstractMap > com.google.api.client.util.GenericData > com.google.api.client.json.GenericJson > TokenResponse > IdTokenResponseConstructors
IdTokenResponse()
public IdTokenResponse()
Methods
clone()
public IdTokenResponse clone()
Type | Description |
IdTokenResponse |
execute(TokenRequest tokenRequest)
public static IdTokenResponse execute(TokenRequest tokenRequest)
Executes the given ID token request, and returns the parsed ID token response.
Name | Description |
tokenRequest | TokenRequest token request |
Type | Description |
IdTokenResponse | parsed successful ID token response |
Type | Description |
IOException | for an error response |
getIdToken()
public final String getIdToken()
Returns the ID token.
Type | Description |
String |
parseIdToken()
public IdToken parseIdToken()
Parses using JsonWebSignature#parse(JsonFactory, String) based on the JSON factory and ID token.
Type | Description |
IdToken |
Type | Description |
IOException |
set(String fieldName, Object value)
public IdTokenResponse set(String fieldName, Object value)
Name | Description |
fieldName | String |
value | Object |
Type | Description |
IdTokenResponse |
setAccessToken(String accessToken)
public IdTokenResponse setAccessToken(String accessToken)
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.
Name | Description |
accessToken | String |
Type | Description |
IdTokenResponse |
setExpiresInSeconds(Long expiresIn)
public IdTokenResponse setExpiresInSeconds(Long expiresIn)
Sets the lifetime in seconds of the access token (for example 3600 for an hour) or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
expiresIn | Long |
Type | Description |
IdTokenResponse |
setIdToken(String idToken)
public IdTokenResponse setIdToken(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.
Name | Description |
idToken | String |
Type | Description |
IdTokenResponse |
setRefreshToken(String refreshToken)
public IdTokenResponse setRefreshToken(String refreshToken)
Sets the refresh token which can be used to obtain new access tokens using the same
authorization grant or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
refreshToken | String |
Type | Description |
IdTokenResponse |
setScope(String scope)
public IdTokenResponse setScope(String scope)
Sets the scope of the access token or null
for none.
Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
Name | Description |
scope | String |
Type | Description |
IdTokenResponse |
setTokenType(String tokenType)
public IdTokenResponse setTokenType(String tokenType)
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.
Name | Description |
tokenType | String |
Type | Description |
IdTokenResponse |