Quantcast
Channel: Hortonworks » All Replies
Viewing all articles
Browse latest Browse all 3435

Reply To: Authorization header in knox

$
0
0

I also added debug code to the ThriftHttpServlet class and dumped the headers (perhaps there is an easier way to debug?)


  private String getAuthHeader(HttpServletRequest request, String authType)
      throws HttpAuthenticationException {
    java.util.Enumeration headerNames = request.getHeaderNames();
    while (headerNames.hasMoreElements()) {
      String key = (String) headerNames.nextElement();
      String value = request.getHeader(key);
      LOG.info("request header:  " + key + " " + value);
    }
    String authHeader = request.getHeader(HttpAuthUtils.AUTHORIZATION);
    // Each http request must have an Authorization header
    if (authHeader == null || authHeader.isEmpty()) {
      throw new HttpAuthenticationException("Authorization header received from the client is empty.");
    }

At any rate, the header is in the logged output (the huge Authorization header value was trimmed for output below)…


2015-02-23 15:49:59,679 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Host hdp.howard.local:10001
2015-02-23 15:49:59,682 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Transfer-Encoding chunked
2015-02-23 15:49:59,682 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Accept application/x-thrift
2015-02-23 15:49:59,713 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Authorization Negotiate YIIFMQYGKwYBBQUCoIIFJTCCBSGgDTAL
2015-02-23 15:49:59,732 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Content-Type application/x-thrift
2015-02-23 15:49:59,732 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  User-Agent Java/THttpClient/HC
2015-02-23 15:49:59,733 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftHttpServlet (ThriftHttpServlet.java:getAuthHeader(316)) - request header:  Connection keep-alive
2015-02-23 15:50:00,040 INFO  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftCLIService (ThriftCLIService.java:OpenSession(232)) - Client protocol version: HIVE_CLI_SERVICE_PROTOCOL_V6
2015-02-23 15:50:00,272 WARN  [HiveServer2-HttpHandler-Pool: Thread-35]: security.UserGroupInformation (UserGroupInformation.java:getGroupNames(1492)) - No groups available for user guest
2015-02-23 15:50:00,273 WARN  [HiveServer2-HttpHandler-Pool: Thread-35]: thrift.ThriftCLIService (ThriftCLIService.java:OpenSession(241)) - Error opening session:


Viewing all articles
Browse latest Browse all 3435

Trending Articles