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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionbooleanTime when access token will expire.Scopes from the access token response.String representation of the access token.inthashCode()static AccessToken.BuildertoString()Returns a string representation of this access token, including the raw token value.
-
Constructor Details
-
AccessToken
- Parameters:
tokenValue- String representation of the access token.expirationTime- Time when access token will expire.
-
-
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.
-
hashCode
public int hashCode() -
toString
Returns a string representation of this access token, including the raw token value.Security Warning: The output of this method includes the raw, unmasked access token value. Do not log this output in production environments as it may expose sensitive credentials.
-
equals
-