public void verifyUser() throws NotAuthorizedException {
    String requestingUser = getRequestingUser();
    if (requestingUser == null) {
      String msg = "No user found.";
      if (!UserGroupInformation.isSecurityEnabled()) {
        msg += "  Missing " + PseudoAuthenticator.USER_NAME + " parameter.";
      }
      throw new NotAuthorizedException(msg);
    }
    if(doAs != null && !doAs.equals(requestingUser)) {
      /*if doAs user is different than logged in user, need to check that
      that logged in user is authorized to run as 'doAs'*/
      ProxyUserSupport.validate(requestingUser, getRequestingHost(requestingUser, request), doAs);
    }
  }
Verify that we have a valid user.  Throw an exception if invalid.
hcatalog/webhcat/svr/src/main/java/org/apache/hive/hcatalog/templeton/Server.java