Package org.forgerock.http.oauth2
Class AccessTokenInfo
java.lang.Object
org.forgerock.http.oauth2.AccessTokenInfo
Represents an OAuth2 Access Token.
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionAccessTokenInfo(JsonValue rawInfo, String token, Set<String> scopes, long expiresAt) Build anAccessTokenInfowith the provided information. -
Method Summary
Modifier and TypeMethodDescriptionReturns the raw JSON as aJsonValue.longReturns the time (expressed as a timestamp in milliseconds since epoch) when this token will be expired.getInfo()Returns the raw JSON as a map.Returns the scopes associated to this token.getToken()Returns the access token identifier issued from the authorization server.
-
Field Details
-
NEVER_EXPIRES
public static final long NEVER_EXPIRESMarker for never ending tokens.- See Also:
-
-
Constructor Details
-
AccessTokenInfo
Build anAccessTokenInfowith the provided information.- Parameters:
rawInfo- raw response messagetoken- token identifierscopes- scopes of the tokenexpiresAt- Token expiration time expressed as a timestamp, in milliseconds since epoch
-
-
Method Details
-
getInfo
Returns the raw JSON as a map.- Returns:
- the raw JSON as a map
-
asJsonValue
Returns the raw JSON as aJsonValue.- Returns:
- the raw JSON as a
JsonValue
-
getToken
Returns the access token identifier issued from the authorization server.- Returns:
- the access token identifier issued from the authorization server
-
getScopes
Returns the scopes associated to this token. Will return an empty Set if no scopes are associated with this token.- Returns:
- the scopes associated to this token.
-
getExpiresAt
public long getExpiresAt()Returns the time (expressed as a timestamp in milliseconds since epoch) when this token will be expired. If theNEVER_EXPIRESconstant is returned, this token is always considered as available.- Returns:
- the time (expressed as a timestamp, in milliseconds since epoch) when this token will be expired.
-