Class AccessToken (1.18.0)

public class AccessToken implements Serializable

Represents a temporary OAuth2 access token and its expiration information.

Inheritance

Object > AccessToken

Implements

Serializable

Static Methods

newBuilder()

public static AccessToken.Builder newBuilder()
Returns
TypeDescription
AccessToken.Builder

Constructors

AccessToken(String tokenValue, Date expirationTime)

public AccessToken(String tokenValue, Date expirationTime)
Parameters
NameDescription
tokenValueString

String representation of the access token.

expirationTimeDate

Time when access token will expire.

Methods

equals(Object obj)

public boolean equals(Object obj)
Parameter
NameDescription
objObject
Returns
TypeDescription
boolean
Overrides

getExpirationTime()

public Date getExpirationTime()

Time when access token will expire.

Returns
TypeDescription
Date

The expiration time as a Date.

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
TypeDescription
List<String>

List of scopes

getTokenValue()

public String getTokenValue()

String representation of the access token.

Returns
TypeDescription
String

The raw access token string value.

hashCode()

public int hashCode()
Returns
TypeDescription
int
Overrides

toBuilder()

public AccessToken.Builder toBuilder()
Returns
TypeDescription
AccessToken.Builder

toString()

public String toString()
Returns
TypeDescription
String
Overrides