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 Details

    • schemeName

      public static final String schemeName
      The name of the Basic authentication scheme.
      See Also:
    • charsetparam

      public static final String charsetparam
      The charset parameter name in the authenticate header.
      See Also:
  • Constructor Details

    • BasicAuthenticator

      public BasicAuthenticator()
      Default constructor.
  • Method Details

    • getAuthorization

      public String getAuthorization(String method, 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:
      method - The request method
      requestUri - The request URI
      authenticateHeader - The server authentication header received
      userName - The username
      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