Package org.forgerock.oauth2.core
Interface Token
- All Known Subinterfaces:
AccessToken
,IntrospectableToken
- All Known Implementing Classes:
MacaroonToken
Models a OAuth2 token.
- Since:
- 12.0.0
-
Method Summary
Modifier and TypeMethodDescriptionGet the audit tracking ID for this token.Gets the token's identifier.Gets the token's information.Gets the token's name.Gets theJsonValue
representation of the token.toMap()
Returns aMap
of data associated with this token which the HTTP caller may be wish to receive.
-
Method Details
-
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
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
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.
-