You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@hive.apache.org by "feiwang (Jira)" <ji...@apache.org> on 2022/06/23 11:02:00 UTC

[jira] [Created] (HIVE-26353) Http auth header for NEGOTIATE is not standard

feiwang created HIVE-26353:
------------------------------

             Summary: Http auth header for NEGOTIATE is not standard
                 Key: HIVE-26353
                 URL: https://issues.apache.org/jira/browse/HIVE-26353
             Project: Hive
          Issue Type: Bug
            Reporter: feiwang


The auth header for http spnego is not standard.

The code link: https://github.com/apache/hive/blob/7b3ecf617a6d46f48a3b6f77e0339fd4ad95a420/jdbc/src/java/org/apache/hive/jdbc/HttpKerberosRequestInterceptor.java#L58-L65


{code:java}
  @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) {
      throw new HttpException(e.getMessage(), e);
    } finally {
      kerberosLock.unlock();
    }
  }
{code}






--
This message was sent by Atlassian Jira
(v8.20.7#820007)