code: private String doPasswdAuth(HttpServletRequest request, String authType)
        throws HttpAuthenticationException {
      String userName = getUsername(request, authType);
      // No-op when authType is NOSASL
      if (!authType.equalsIgnoreCase(HiveAuthFactory.AuthTypes.NOSASL.toString())) {
        try {
          AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType);
          PasswdAuthenticationProvider provider =
              AuthenticationProviderFactory.getAuthenticationProvider(authMethod);
          provider.Authenticate(userName, getPassword(request, authType));
  
        } catch (Exception e) {
          throw new HttpAuthenticationException(e);
        }
      }
      return userName;
    }
docs: Do the LDAP/PAM authentication
  @param request
  @param authType
  @throws HttpAuthenticationException