Package org.forgerock.oauth2.core
Interface Token
-
- All Known Subinterfaces:
AccessToken
,IntrospectableToken
- All Known Implementing Classes:
MacaroonToken
@SupportedAll public interface Token
Models a OAuth2 token.- Since:
- 12.0.0
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description String
getAuditTrackingId()
Get the audit tracking ID for this token.String
getTokenId()
Gets the token's identifier.Map<String,Object>
getTokenInfo()
Gets the token's information.String
getTokenName()
Gets the token's name.JsonValue
toJsonValue()
Gets theJsonValue
representation of the token.Map<String,Object>
toMap()
Returns aMap
of data associated with this token which the HTTP caller may be wish to receive.
-
-
-
Method Detail
-
getTokenId
String getTokenId()
Gets the token's identifier.- Returns:
- The token's id.
-
getTokenName
String getTokenName()
Gets the token's name.- Returns:
- The token's name.
-
toMap
Map<String,Object> toMap()
Returns aMap
of data associated with this token which the HTTP caller may be wish to receive.For example, when requesting an access token, the HTTP response body will contain JSON built using the result of calling this method. This response will include (amongst other things):
- the access token reference
- the access token type (BEARER)
- the access token expiry time
- the access token scopes
- the refresh token reference (if one was created as part of the current HTTP call)
- Returns:
- A
Map
of the token's key data.
-
getTokenInfo
Map<String,Object> getTokenInfo()
Gets the token's information.- Returns:
- A
Map
of the token's information.
-
toJsonValue
JsonValue toJsonValue()
Gets theJsonValue
representation of the token. The JsonValue should be treated as read-only. Updating the JsonValue may or may not update the token itself and this behaviour shouldn't be relied on.- Returns:
- The
JsonValue
representation of the token.
-
getAuditTrackingId
String getAuditTrackingId()
Get the audit tracking ID for this token.- Returns:
- The tracking ID.
-
-