Class AuthHeader


public class AuthHeader extends Object
Parser for authentication header strings for both challenge and credentials.
  • This parser is scheme-specific. e.g. digest credentials can not be token68.
  • This parser does not check auth-params names.
  • The auth-params map has lower case keys.
  • Method Details

    • parseAuth

      public static AuthHeader parseAuth(String string)
      Create an AuthHeader by parsing an "Authorization" header.
    • parseChallenge

      public static AuthHeader parseChallenge(String string)
      Create an AuthHeader by parsing a "WWW-Authenticate" header.
    • bearerToken

      public static AuthHeader bearerToken(String tokenString)
      Create an AuthHeader for bearer with a token value.
    • getAuthScheme

      public AuthScheme getAuthScheme()
      Get the AuthScheme.
    • getAuthSchemeName

      public String getAuthSchemeName()
      Get the auth scheme as written in the authentication header value.
    • getAuthArgs

      public String getAuthArgs()
      Get the string after the auth scheme as written in the authentication header value.
    • getAuthParams

      public Map<String,String> getAuthParams()
      Any auth scheme value that has a=b auth-params, else null.
    • isBasicAuth

      public boolean isBasicAuth()
      Is this basic auth?
    • getBasicUserPassword

      public String getBasicUserPassword()
      Return user-password (still base64 encoded) or null (if not basic auth)
    • isDigestAuth

      public boolean isDigestAuth()
      Is this Digest auth? The digest auth-params are available from getAuthParams()
    • isBearerAuth

      public boolean isBearerAuth()
      Is this Bearer auth?
    • getBearerToken

      public String getBearerToken()
    • isUnknownAuth

      public boolean isUnknownAuth()
      Is this some unkown scheme? (not basic, digest or bearer). The rest of the line is available from getUnknown().
    • getUnknown

      public String getUnknown()
      The rest of the line for "unknown"