org.apache.catalina.authenticator

## Class BasicAuthenticator.BasicCredentials

- java.lang.Object
- - org.apache.catalina.authenticator.BasicAuthenticator.BasicCredentials

- Enclosing class:
    BasicAuthenticator

      public static class BasicAuthenticator.BasicCredentials
      extends Object

  Parser for an HTTP Authorization header for BASIC authentication as per RFC 2617 section 2, and the Base64 encoded credentials as per RFC 2045 section 6.8.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `BasicAuthenticator.BasicCredentials(ByteChunk input)` Parse the HTTP Authorization header for BASIC authentication as per RFC 2617 section 2, and the Base64 encoded credentials as per RFC 2045 section 6.8.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `String` | `getPassword()` Trivial accessor.
    `String` | `getUsername()` Trivial accessor.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### BasicAuthenticator.BasicCredentials

          public BasicAuthenticator.BasicCredentials(ByteChunk input)
                                              throws IllegalArgumentException

      Parse the HTTP Authorization header for BASIC authentication as per RFC 2617 section 2, and the Base64 encoded credentials as per RFC 2045 section 6.8.
      Parameters:
        `input` - The header value to parse in-place
      Throws:
        `IllegalArgumentException` - If the header does not conform to RFC 2617

  - ### Method Detail

    - #### getUsername

          public String getUsername()

      Trivial accessor.
      Returns:
        the decoded username token as a String, which is never be `null`, but can be empty.

    - #### getPassword

          public String getPassword()

      Trivial accessor.
      Returns:
        the decoded password token as a String, or `null` if no password was found in the credentials.

Copyright © 2000-2017 Apache Software Foundation. All Rights Reserved.