Interface IntrospectableToken

All Superinterfaces:
Token
All Known Subinterfaces:
AccessToken
All Known Implementing Classes:
MacaroonToken

@SupportedAll public interface IntrospectableToken extends Token
An OAuth 2.0 token abstraction for introspection.
  • Method Details

    • getExpiryTime

      long getExpiryTime()
      Gets the token's expiry time.
      Returns:
      The token's expiry time.
    • isExpired

      boolean isExpired()
      Gets whether the token has expired.
      Returns:
      Whether the token has expired.
    • getRealm

      String getRealm()
      Gets the token's realm.
      Returns:
      The token's realm.
    • getClientId

      String getClientId()
      Gets the token's client id.
      Returns:
      The token's client id.
    • getResourceOwnerId

      String getResourceOwnerId()
      Gets the token's resource owner id.
      Returns:
      The token's resource owner id.
    • getScope

      Set<String> getScope()
      Gets the token's scopes.
      Returns:
      The token's scopes.
    • getAuthTimeSeconds

      long getAuthTimeSeconds()
      Gets the end user's authentication time in seconds.
      Returns:
      The authentication time.
    • getAuthLevel

      Integer getAuthLevel()
      Gets the session auth level.
      Returns:
      The session auth level.
    • getGrantType

      String getGrantType()
      Gets the grant type that was used to produce the token.
      Returns:
      The grant type or null if grant type was not set.
    • getResourceOwner

      default org.forgerock.oauth2.core.ResourceOwner getResourceOwner()
      It turns instance of IntrospectableToken into ResourceOwner.
      Returns:
      The resource owner retrieved from the token.
    • getCustomFields

      Map<String,Object> getCustomFields()
      Gets the custom fields added to the token.
      Returns:
      The custom fields added to the token.
    • getAudience

      Collection<String> getAudience()
      Gets the audience for the token.
      Returns:
      The audience for the token.
    • isIntrospectableBy

      default boolean isIntrospectableBy(String clientId)
      Returns true if the given client may introspect this token.

      The default implementation preserves the legacy equality check (issuing client only). Token subclasses may override to support audience-based authorization.

      Parameters:
      clientId - the client_id of the client requesting introspection
      Returns:
      true if the client is authorized to introspect this token