Class NAAccessToken

All Implemented Interfaces:
Serializable, Comparable<Identifier>, net.minidev.json.JSONAware

@Immutable public class NAAccessToken extends AccessToken
Access token of type not applicable (N/A), intended for use in OAuth 2.0 token exchange scenarios.

Related specifications:

  • OAuth 2.0 Token Exchange (RFC 8693)
See Also:
  • Constructor Details

    • NAAccessToken

      public NAAccessToken(String value, long lifetime, Scope scope, TokenTypeURI issuedTokenType)
      Creates a new N/A access token with the specified value.
      Parameters:
      value - The access token value. Must not be null or empty string.
      lifetime - The lifetime in seconds, 0 if not specified.
      scope - The scope, null if not specified.
      issuedTokenType - The token type URI, null if not specified.
  • Method Details

    • toAuthorizationHeader

      Description copied from class: AccessToken
      Returns the Authorization HTTP request header value for this access token.
      Specified by:
      toAuthorizationHeader in class AccessToken
      Returns:
      The Authorization header value.
    • parse

      public static NAAccessToken parse(net.minidev.json.JSONObject jsonObject) throws ParseException
      Parses a N/A access token from a JSON object access token response.
      Parameters:
      jsonObject - The JSON object to parse. Must not be null.
      Returns:
      The N/A access token.
      Throws:
      ParseException - If the JSON object couldn't be parsed to a N/A access token.