Class AccessToken

java.lang.Object
com.revetsec.oauth.AccessToken

@Immutable public final class AccessToken extends Object
A raw access token returned by an AS. It is not a verified identity or a validated resource-server token. The value is secret and appears only through explicit accessors.
Since:
1.0.0
Author:
Mark Allen
  • Method Details

    • getValue

      Explicitly releases the secret token value.
      Returns:
      the token value
      Since:
      1.0.0
    • getTokenType

      Returns the AS's token type, with its original case.
      Returns:
      token type
      Since:
      1.0.0
    • isBearer

      Reports whether the authorization server named the Bearer token type, ignoring ASCII case. This does not mean the token value is safe to place in a header.
      Returns:
      whether the token type is Bearer
      Since:
      1.0.0
    • getExpiresAt

      Returns the request-start-anchored expiry when the AS supplied one.
      Returns:
      expiry
      Since:
      1.0.0
    • getAuthorizationHeaderValue

      Returns a Bearer Authorization header. Non-Bearer types and values outside RFC 6750's b64token grammar are refused, including whitespace and line breaks.
      Returns:
      the header value
      Since:
      1.0.0
    • toString

      Redacts the token.
      Overrides:
      toString in class Object
      Returns:
      a redacted description
      Since:
      1.0.0