BasicAuthenticator (Apache Tomcat 9.0.117 API Documentation)
Description: declaration: package: org.apache.tomcat.websocket, class: BasicAuthenticator

# Class BasicAuthenticator

java.lang.Object
org.apache.tomcat.websocket.Authenticator
org.apache.tomcat.websocket.BasicAuthenticator

public class BasicAuthenticator extends Authenticator
Authenticator supporting the BASIC authentication method.

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final String`
  `charsetparam`
  `static final String`
  `schemeName`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `BasicAuthenticator()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `String`
  `getAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm)`
  Generate the authorization header value that will be sent to the server.
  `String`
  `getSchemeName()`
  Get the authentication method.

  ### Methods inherited from class Authenticator

  `getAuthorization, parseAuthenticateHeader, parseWWWAuthenticateHeader, validatePassword, validateRealm, validateUsername`

  ### Methods inherited from class Object

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

- ## Field Details

  - ### schemeName

    public static final String schemeName
    See Also:
      - Constant Field Values

  - ### charsetparam

    public static final String charsetparam
    See Also:
      - Constant Field Values

- ## Constructor Details

  - ### BasicAuthenticator

    public BasicAuthenticator()

- ## Method Details

  - ### getAuthorization

    public String getAuthorization(String requestUri, String authenticateHeader, String userName, String userPassword, String userRealm) throws AuthenticationException
    Description copied from class: `Authenticator`
    Generate the authorization header value that will be sent to the server.
    Specified by:
      `getAuthorization` in class `Authenticator`
    Parameters:
      `requestUri` - The request URI
      `authenticateHeader` - The server authentication header received
      `userName` - The user name
      `userPassword` - The user password
      `userRealm` - The realm for which the provided username and password are valid. `null` to indicate all realms.
    Returns:
      The generated authorization header value
    Throws:
      `AuthenticationException` - When an error occurs

  - ### getSchemeName

    public String getSchemeName()
    Description copied from class: `Authenticator`
    Get the authentication method.
    Specified by:
      `getSchemeName` in class `Authenticator`
    Returns:
      the authentication scheme