Class TokenResponse
java.lang.Object
java.util.AbstractMap<String,Object>
com.google.api.client.util.GenericData
com.google.api.client.json.GenericJson
com.google.api.client.auth.oauth2.TokenResponse
- Direct Known Subclasses:
IdTokenResponse
public class TokenResponse
extends com.google.api.client.json.GenericJson
OAuth 2.0 JSON model for a successful access token response as specified in Successful Response.
Implementation is not thread-safe.
- Since:
- 1.7
-
Nested Class Summary
Nested classes/interfaces inherited from class com.google.api.client.util.GenericData
com.google.api.client.util.GenericData.FlagsNested classes/interfaces inherited from class AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K, V> -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate StringAccess token issued by the authorization server.private LongLifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.private StringRefresh token which can be used to obtain new access tokens usingRefreshTokenRequestornullfor none.private StringScope of the access token as specified in Access Token Scope ornullfor none.private StringToken type (as specified in Access Token Types). -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionclone()final StringReturns the access token issued by the authorization server.final LongReturns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.final StringReturns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.final StringgetScope()Returns the scope of the access token ornullfor none.final StringReturns the token type (as specified in Access Token Types).setAccessToken(String accessToken) Sets the access token issued by the authorization server.setExpiresInSeconds(Long expiresInSeconds) Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.setRefreshToken(String refreshToken) Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Sets the scope of the access token ornullfor none.setTokenType(String tokenType) Sets the token type (as specified in Access Token Types).Methods inherited from class com.google.api.client.json.GenericJson
getFactory, setFactory, toPrettyString, toStringMethods inherited from class com.google.api.client.util.GenericData
entrySet, get, getClassInfo, getUnknownKeys, put, putAll, remove, setUnknownKeysMethods inherited from class AbstractMap
clear, containsKey, containsValue, equals, hashCode, isEmpty, keySet, size, valuesMethods inherited from interface Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Field Details
-
accessToken
Access token issued by the authorization server. -
tokenType
Token type (as specified in Access Token Types). -
expiresInSeconds
Lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none. -
refreshToken
Refresh token which can be used to obtain new access tokens usingRefreshTokenRequestornullfor none. -
scope
Scope of the access token as specified in Access Token Scope ornullfor none.
-
-
Constructor Details
-
TokenResponse
public TokenResponse()
-
-
Method Details
-
getAccessToken
Returns the access token issued by the authorization server. -
setAccessToken
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.
-
getTokenType
Returns the token type (as specified in Access Token Types). -
setTokenType
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.
-
getExpiresInSeconds
Returns the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none. -
setExpiresInSeconds
Sets the lifetime in seconds of the access token (for example 3600 for an hour) ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getRefreshToken
Returns the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none. -
setRefreshToken
Sets the refresh token which can be used to obtain new access tokens using the same authorization grant ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
getScope
Returns the scope of the access token ornullfor none. -
setScope
Sets the scope of the access token ornullfor none.Overriding is only supported for the purpose of calling the super implementation and changing the return type, but nothing else.
-
set
- Overrides:
setin classcom.google.api.client.json.GenericJson
-
clone
- Overrides:
clonein classcom.google.api.client.json.GenericJson
-