Package com.google.auth.oauth2
Class AccessToken
java.lang.Object
com.google.auth.oauth2.AccessToken
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
IdToken
Represents a temporary OAuth2 access token and its expiration information.
- See Also:
-
Nested Class Summary
Nested Classes -
Field Summary
Fields -
Constructor Summary
ConstructorsModifierConstructorDescriptionprivate
AccessToken
(AccessToken.Builder builder) AccessToken
(String tokenValue, Date expirationTime) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Time when access token will expire.(package private) Long
Scopes from the access token response.String representation of the access token.int
hashCode()
static AccessToken.Builder
toString()
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
tokenValue
-
expirationTimeMillis
-
scopes
-
-
Constructor Details
-
AccessToken
- Parameters:
tokenValue
- String representation of the access token.expirationTime
- Time when access token will expire.
-
AccessToken
-
-
Method Details
-
newBuilder
-
toBuilder
-
getScopes
Scopes from the access token response. Not all credentials provide scopes in response and as per https://datatracker.ietf.org/doc/html/rfc6749#section-5.1 it is optional in the response.- Returns:
- List of scopes
-
getTokenValue
String representation of the access token.- Returns:
- The raw access token string value.
-
getExpirationTime
Time when access token will expire.- Returns:
- The expiration time as a
Date
.
-
getExpirationTimeMillis
Long getExpirationTimeMillis() -
hashCode
public int hashCode() -
toString
-
equals
-