@Override
  public void setConf(Configuration conf) {
    this.conf = conf;
    UserGroupInformation ugi = null;
    String proxyUser = conf.get(PROXY_USER_NAME);

    if (proxyUser == null){
      super.setConf(conf);
      return;
    }

    // If we're here, proxy user is set.

    try {
      ugi = UserGroupInformation.createRemoteUser(proxyUser);
    } catch (Exception e) {
      throw new RuntimeException(e);
    }

    if (ugi == null) {
      throw new RuntimeException(
          "Can not initialize ProxyUserAuthenticator for user ["+proxyUser+"]");
    }

    this.userName = ugi.getShortUserName();
    if (ugi.getGroupNames() != null) {
      this.groupNames = Arrays.asList(ugi.getGroupNames());
    }
  }
ProxyUserAuthenticator extends HadoopDefaultAuthenticator
but honours a proxy config setting proxy.user.name instead of the
current user if set. This allows server processes like webhcat which
proxy other users to easily specify an override if allowed.

It is no longer necessary to use this class with WebHCat as of Hive 0.14.
ql/src/java/org/apache/hadoop/hive/ql/security/ProxyUserAuthenticator.java