private RemoteUserIdentity doKerberosAuth(HttpServletRequest request)
    throws HttpAuthenticationException {
    HttpKerberosServerAction action = new HttpKerberosServerAction(request, httpUGI);
    try {
      String principal = httpUGI.doAs(action);
      return new RemoteUserIdentity(principal, action.outToken);
    } catch (Exception e) {
      LOG.info("Failed to authenticate with {} kerberos principal", httpUGI.getUserName());
      throw new HttpAuthenticationException(e);
    }
  }
Do the GSS-API kerberos authentication. We already have a logged in subject in the form of
httpUGI, which GSS-API will extract information from.
hbase-thrift/src/main/java/org/apache/hadoop/hbase/thrift/ThriftHttpServlet.java