Class AccessTokenInfo

java.lang.Object
org.forgerock.http.oauth2.AccessTokenInfo

public class AccessTokenInfo extends Object
Represents an OAuth2 Access Token.
  • Field Details

    • NEVER_EXPIRES

      public static final long NEVER_EXPIRES
      Marker for never ending tokens.
      See Also:
  • Constructor Details

    • AccessTokenInfo

      public AccessTokenInfo(JsonValue rawInfo, String token, Set<String> scopes, long expiresAt)
      Build an AccessTokenInfo with the provided information.
      Parameters:
      rawInfo - raw response message
      token - token identifier
      scopes - scopes of the token
      expiresAt - Token expiration time expressed as a timestamp, in milliseconds since epoch
  • Method Details

    • 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 a JsonValue.
      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 the NEVER_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.