Class IdTokenResponse (1.36.0)

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 > IdTokenResponse

Static Methods

execute(TokenRequest tokenRequest)

public static IdTokenResponse execute(TokenRequest tokenRequest)

Executes the given ID token request, and returns the parsed ID token response.

Parameter
Name Description
tokenRequest TokenRequest

token request

Returns
Type Description
IdTokenResponse

parsed successful ID token response

Exceptions
Type Description
IOException

for an error response

Constructors

IdTokenResponse()

public IdTokenResponse()

Methods

clone()

public IdTokenResponse clone()
Returns
Type Description
IdTokenResponse
Overrides

getIdToken()

public final String getIdToken()

Returns the ID token.

Returns
Type Description
String

parseIdToken()

public IdToken parseIdToken()

Parses using JsonWebSignature#parse(JsonFactory, String) based on the JSON factory and ID token.

Returns
Type Description
IdToken
Exceptions
Type Description
IOException

set(String fieldName, Object value)

public IdTokenResponse set(String fieldName, Object value)
Parameters
Name Description
fieldName String
value Object
Returns
Type Description
IdTokenResponse
Overrides

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.

Parameter
Name Description
accessToken String
Returns
Type Description
IdTokenResponse
Overrides

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.

Parameter
Name Description
expiresIn Long
Returns
Type Description
IdTokenResponse
Overrides

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.

Parameter
Name Description
idToken String
Returns
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.

Parameter
Name Description
refreshToken String
Returns
Type Description
IdTokenResponse
Overrides

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.

Parameter
Name Description
scope String
Returns
Type Description
IdTokenResponse
Overrides

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.

Parameter
Name Description
tokenType String
Returns
Type Description
IdTokenResponse
Overrides