@Override
  protected void addHttpAuthHeader(HttpRequest httpRequest, HttpContext httpContext) throws Exception {
    try {
      // Generate the service ticket for sending to the server.
      // Locking ensures the tokens are unique in case of concurrent requests
      kerberosLock.lock();
      String kerberosAuthHeader = HttpAuthUtils.getKerberosServiceTicket(principal, host, serverHttpUrl, loggedInSubject);
      // Set the session key token (Base64 encoded) in the headers
      httpRequest.addHeader(HttpAuthUtils.AUTHORIZATION + ": " + HttpAuthUtils.NEGOTIATE + " ", kerberosAuthHeader);
    } catch (Exception e) {
      // e.getMessage() is null at UndeclaredThrowableException
      throw new HttpException("Failed to find any Kerberos ticket", e);
    } finally {
      kerberosLock.unlock();
    }
  }
Authentication interceptor which adds Base64 encoded payload,
containing the username and kerberos service ticket,
to the outgoing http request header.
jdbc/src/java/org/apache/hive/jdbc/HttpKerberosRequestInterceptor.java