Class BasicAuthenticator

All Implemented Interfaces:
MBeanRegistration, RegistrationListener, Authenticator, Contained, JmxEnabled, Lifecycle, Valve

public class BasicAuthenticator extends AuthenticatorBase
An Authenticator and Valve implementation of HTTP BASIC Authentication, as outlined in RFC 7617: "The 'Basic' HTTP Authentication Scheme"
Author:
Craig R. McClanahan
  • Constructor Details

    • BasicAuthenticator

      public BasicAuthenticator()
  • Method Details

    • getCharset

      public String getCharset()
    • setCharset

      public void setCharset(String charsetString)
    • getTrimCredentials

      public boolean getTrimCredentials()
    • setTrimCredentials

      public void setTrimCredentials(boolean trimCredentials)
    • doAuthenticate

      protected boolean doAuthenticate(Request request, HttpServletResponse response) throws IOException
      Description copied from class: AuthenticatorBase
      Provided for sub-classes to implement their specific authentication mechanism.
      Specified by:
      doAuthenticate in class AuthenticatorBase
      Parameters:
      request - The request that triggered the authentication
      response - The response associated with the request
      Returns:
      true if the the user was authenticated, otherwise false, in which case an authentication challenge will have been written to the response
      Throws:
      IOException - If an I/O problem occurred during the authentication process
    • getAuthMethod

      protected String getAuthMethod()
      Description copied from class: AuthenticatorBase
      Return the authentication method, which is vendor-specific and not defined by HttpServletRequest.
      Specified by:
      getAuthMethod in class AuthenticatorBase
      Returns:
      the authentication method, which is vendor-specific and not defined by HttpServletRequest.
    • isPreemptiveAuthPossible

      protected boolean isPreemptiveAuthPossible(Request request)
      Description copied from class: AuthenticatorBase
      Can the authenticator perform preemptive authentication for the given request?
      Overrides:
      isPreemptiveAuthPossible in class AuthenticatorBase
      Parameters:
      request - The request to check for credentials
      Returns:
      true if preemptive authentication is possible, otherwise false