Class BearerToken


  • public class BearerToken
    extends java.lang.Object
    OAuth 2.0 helper for accessing protected resources using the Bearer Token specification.
    Since:
    1.7
    • Field Detail

      • PARAM_NAME

        static final java.lang.String PARAM_NAME
        Query and form-encoded parameter name.
        See Also:
        Constant Field Values
      • INVALID_TOKEN_ERROR

        static final java.util.regex.Pattern INVALID_TOKEN_ERROR
        In case an abnormal HTTP response is received with WWW-Authenticate header, and its value contains this error pattern, we will try to refresh the token.
    • Constructor Detail

      • BearerToken

        public BearerToken()
    • Method Detail

      • authorizationHeaderAccessMethod

        public static Credential.AccessMethod authorizationHeaderAccessMethod()
        Returns a new instance of an immutable and thread-safe OAuth 2.0 method for accessing protected resources using the Authorization Request Header Field.

        According to the specification, this method MUST be supported by resource servers.

      • queryParameterAccessMethod

        public static Credential.AccessMethod queryParameterAccessMethod()
        Returns a new instance of an immutable and thread-safe OAuth 2.0 method for accessing protected resources using the URI Query Parameter.