Package org.forgerock.http.oauth2
Class AccessTokenInfo
- java.lang.Object
-
- org.forgerock.http.oauth2.AccessTokenInfo
-
public class AccessTokenInfo extends Object
Represents an OAuth2 Access Token.
-
-
Field Summary
Fields Modifier and Type Field Description static long
NEVER_EXPIRES
Marker for never ending tokens.
-
Constructor Summary
Constructors Constructor Description AccessTokenInfo(JsonValue rawInfo, String token, Set<String> scopes, long expiresAt)
Build anAccessTokenInfo
with the provided information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description JsonValue
asJsonValue()
Returns the raw JSON as aJsonValue
.long
getExpiresAt()
Returns the time (expressed as a timestamp in milliseconds since epoch) when this token will be expired.Map<String,Object>
getInfo()
Returns the raw JSON as a map.Set<String>
getScopes()
Returns the scopes associated to this token.String
getToken()
Returns the access token identifier issued from the authorization server.
-
-
-
Field Detail
-
NEVER_EXPIRES
public static final long NEVER_EXPIRES
Marker for never ending tokens.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AccessTokenInfo
public AccessTokenInfo(JsonValue rawInfo, String token, Set<String> scopes, long expiresAt)
Build anAccessTokenInfo
with 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 Detail
-
getInfo
public Map<String,Object> getInfo()
Returns the raw JSON as a map.- Returns:
- the raw JSON as a map.
-
asJsonValue
public JsonValue asJsonValue()
Returns the raw JSON as aJsonValue
.- Returns:
- the raw JSON as a
JsonValue
.
-
getToken
public String getToken()
Returns the access token identifier issued from the authorization server.- Returns:
- the access token identifier issued from the authorization server.
-
getScopes
public Set<String> 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_EXPIRES
constant 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.
-
-