Class TokenResponse (1.32.1)

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
TypeDescription
TokenResponse
Overrides
com.google.api.client.json.GenericJson.clone()

getAccessToken()

public String getAccessToken()

Returns the access token issued by the authorization server.

Returns
TypeDescription
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
TypeDescription
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
TypeDescription
String

getScope()

public String getScope()

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

Returns
TypeDescription
String

getTokenType()

public String getTokenType()

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

Returns
TypeDescription
String

set(String fieldName, Object value)

public TokenResponse set(String fieldName, Object value)
Parameters
NameDescription
fieldNameString
valueObject
Returns
TypeDescription
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
NameDescription
accessTokenString
Returns
TypeDescription
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
NameDescription
expiresInSecondsLong
Returns
TypeDescription
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
NameDescription
refreshTokenString
Returns
TypeDescription
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
NameDescription
scopeString
Returns
TypeDescription
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
NameDescription
tokenTypeString
Returns
TypeDescription
TokenResponse