Class 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
    • Constructor Detail

      • Authenticator

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

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

      • extractAuthHeader

        public static void extractAuthHeader​(javax.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()
      • doAuthenticate

        protected Subject doAuthenticate()
      • initSubject

        protected Subject initSubject()
      • checkRoles

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