private String doPasswdAuth(HttpServletRequest request, String authType)
      throws HttpAuthenticationException {
    String userName = httpAuthService.getUsername(request);
    // No-op when authType is NOSASL
    if (!authType.toLowerCase().contains(HiveAuthConstants.AuthTypes.NOSASL.toString().toLowerCase())) {
      try {
        AuthMethods authMethod = AuthMethods.getValidAuthMethod(authType);
        PasswdAuthenticationProvider provider =
            AuthenticationProviderFactory.getAuthenticationProvider(authMethod, hiveConf);
        provider.authenticate(userName, httpAuthService.getPassword(request));
      } catch (Exception e) {
        throw new HttpAuthenticationException(e);
      }
    }
    return userName;
  }
Do the LDAP/PAM authentication
@param request request to authenticate
@param authType type of authentication
@throws HttpAuthenticationException on error authenticating end user
service/src/java/org/apache/hive/service/cli/thrift/ThriftHttpServlet.java