private String doTokenAuth(HttpServletRequest request)
      throws HttpAuthenticationException {
    String tokenStr = request.getHeader(HIVE_DELEGATION_TOKEN_HEADER);
    try {
      return hiveAuthFactory.verifyDelegationToken(tokenStr);
    } catch (HiveSQLException e) {
      throw new HttpAuthenticationException(e);
    }
  }
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