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 > TokenResponseConstructors
TokenResponse()
public TokenResponse()
Methods
clone()
public TokenResponse clone()
Type | Description |
TokenResponse |
getAccessToken()
public String getAccessToken()
Returns the access token issued by the authorization server.
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.
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.
Type | Description |
String |
getScope()
public String getScope()
Returns the scope of the access token or null
for none.
Type | Description |
String |
getTokenType()
public String getTokenType()
Returns the token type (as specified in Access Token Types).
Type | Description |
String |
set(String fieldName, Object value)
public TokenResponse set(String fieldName, Object value)
Name | Description |
fieldName | String |
value | Object |
Type | Description |
TokenResponse |
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.
Name | Description |
accessToken | String |
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.
Name | Description |
expiresInSeconds | Long |
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.
Name | Description |
refreshToken | String |
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.
Name | Description |
scope | String |
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.
Name | Description |
tokenType | String |
Type | Description |
TokenResponse |