Package com.google.auth.oauth2
Class AccessToken
- java.lang.Object
-
- com.google.auth.oauth2.AccessToken
-
- All Implemented Interfaces:
Serializable
- Direct Known Subclasses:
IdToken
public class AccessToken extends Object implements Serializable
Represents a temporary OAuth2 access token and its expiration information.- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
AccessToken.Builder
-
Constructor Summary
Constructors Constructor Description AccessToken(String tokenValue, Date expirationTime)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
equals(Object obj)
Date
getExpirationTime()
Time when access token will expire.List<String>
getScopes()
Scopes from the access token response.String
getTokenValue()
String representation of the access token.int
hashCode()
static AccessToken.Builder
newBuilder()
AccessToken.Builder
toBuilder()
String
toString()
-
-
-
Method Detail
-
newBuilder
public static AccessToken.Builder newBuilder()
-
toBuilder
public AccessToken.Builder toBuilder()
-
getScopes
public List<String> 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
public String getTokenValue()
String representation of the access token.- Returns:
- The raw access token string value.
-
getExpirationTime
public Date getExpirationTime()
Time when access token will expire.- Returns:
- The expiration time as a
Date
.
-
-