Class Authenticator

java.lang.Object
io.hawt.system.Authenticator

public class Authenticator extends Object
Authenticator performs authentication using JAAS with the LoginContext for the chosen realm.

Authenticator supports the following authentication methods:

  • a set of user name and password
  • client certificates
  • Field Details

  • Constructor Details

    • Authenticator

      public Authenticator(jakarta.servlet.http.HttpServletRequest request, AuthenticationConfiguration authConfiguration, String username, String password)
      Explicit username/password authenticator when authenticating users from login page.
    • Authenticator

      public Authenticator(jakarta.servlet.http.HttpServletRequest request, AuthenticationConfiguration authConfiguration)
      Request-based authenticator such as when authenticating direct Jolokia accesses.
  • Method Details

    • extractAuthHeader

      public static void extractAuthHeader(jakarta.servlet.http.HttpServletRequest request, BiConsumer<String,String> callback)
      Extracts username/password from Authorization header. Callback is invoked only when Authorization header is present.
    • isUsernamePasswordSet

      public boolean isUsernamePasswordSet()
    • hasNoCredentials

      public boolean hasNoCredentials()
    • logout

      public static void logout(AuthenticationConfiguration authConfiguration, Subject subject)
    • authenticate

      public AuthenticateResult authenticate(Consumer<Subject> callback)
    • doAuthenticate

      protected Subject doAuthenticate()
    • login

      protected void login(Subject subject, String realm, Configuration configuration) throws LoginException
      Throws:
      LoginException
    • checkRoles

      protected boolean checkRoles(Subject subject, String role, String rolePrincipalClasses)