public class OpenAmAccessToken extends Object implements AccessToken
AccessToken
as returned by the OpenAM tokeninfo endpoint.
curl https://openam.example.com:8443/openam/oauth2/tokeninfo?access_token=70e5776c-b0fa-4c70-9962-defb0e9c3cd6
Example of OpenAM returned Json value (for the previous request):
{
"scope": [
"email",
"profile"
],
"grant_type": "password",
"realm": "/",
"token_type": "Bearer",
"expires_in": 471,
"access_token": "70e5776c-b0fa-4c70-9962-defb0e9c3cd6",
"email": "",
"profile": ""
}
Modifier and Type | Class and Description |
---|---|
static class |
OpenAmAccessToken.Builder
Build helper for
OpenAmAccessToken . |
NEVER_EXPIRES
Constructor and Description |
---|
OpenAmAccessToken(JsonValue rawInfo,
String token,
Set<String> scopes,
long expiresAt)
Builds a
AccessToken with the result of a call to the tokeninfo endpoint. |
Modifier and Type | Method and Description |
---|---|
JsonValue |
asJsonValue()
Returns the raw JSON as returned by the tokeninfo endpoint.
|
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.
|
public OpenAmAccessToken(JsonValue rawInfo, String token, Set<String> scopes, long expiresAt)
AccessToken
with the result of a call to the tokeninfo endpoint.rawInfo
- raw response message.token
- token identifierscopes
- scopes of the tokenexpiresAt
- When this token will expirespublic Map<String,Object> getInfo()
AccessToken
getInfo
in interface AccessToken
public JsonValue asJsonValue()
AccessToken
asJsonValue
in interface AccessToken
public String getToken()
AccessToken
getToken
in interface AccessToken
public Set<String> getScopes()
AccessToken
getScopes
in interface AccessToken
public long getExpiresAt()
AccessToken
AccessToken.NEVER_EXPIRES
constant is returned, this token is always considered as available.getExpiresAt
in interface AccessToken
Copyright 2011-2015 ForgeRock AS.