Class TokenResponse (1.36.0)

public class TokenResponse extends GenericJson

OAuth 2.0 JSON model for a successful access token response as specified in Successful Response.

Implementation is not thread-safe.

Inheritance

Object > java.util.AbstractMap > com.google.api.client.util.GenericData > com.google.api.client.json.GenericJson > TokenResponse

Constructors

TokenResponse()

public TokenResponse()

Methods

clone()

public TokenResponse clone()
Returns
Type Description
TokenResponse
Overrides
com.google.api.client.json.GenericJson.clone()

getAccessToken()

public String getAccessToken()

Returns the access token issued by the authorization server.

Returns
Type Description
String

getExpiresInSeconds()

public Long getExpiresInSeconds()

Returns the lifetime in seconds of the access token (for example 3600 for an hour) or null for none.

Returns
Type Description
Long

getRefreshToken()

public String getRefreshToken()

Returns the refresh token which can be used to obtain new access tokens using the same authorization grant or null for none.

Returns
Type Description
String

getScope()

public String getScope()

Returns the scope of the access token or null for none.

Returns
Type Description
String

getTokenType()

public String getTokenType()

Returns the token type (as specified in Access Token Types).

Returns
Type Description
String

set(String fieldName, Object value)

public TokenResponse set(String fieldName, Object value)
Parameters
Name Description
fieldName String
value Object
Returns
Type Description
TokenResponse
Overrides
com.google.api.client.json.GenericJson.set(java.lang.String,java.lang.Object)

setAccessToken(String accessToken)

public TokenResponse 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
TokenResponse

setExpiresInSeconds(Long expiresInSeconds)

public TokenResponse setExpiresInSeconds(Long expiresInSeconds)

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
expiresInSeconds Long
Returns
Type Description
TokenResponse

setRefreshToken(String refreshToken)

public TokenResponse 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
TokenResponse

setScope(String scope)

public TokenResponse 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
TokenResponse

setTokenType(String tokenType)

public TokenResponse 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
TokenResponse