From 77b6ee0dcada2a050e19257ab7422e63c45907f5 Mon Sep 17 00:00:00 2001 From: Cheng Pan Date: Mon, 18 Jul 2022 14:59:17 +0800 Subject: [PATCH] [KYUUBI #3093] Fix Kyuubi Hive JDBC driver SPNEGO header ### _Why are the changes needed?_ This fixed the SPNEGO implementation bug. https://datatracker.ietf.org/doc/html/rfc4559#section-5 ### _How was this patch tested?_ - [ ] Add some test cases that check the changes thoroughly including negative and positive cases if possible - [ ] Add screenshots for manual tests if appropriate - [x] [Run test](https://kyuubi.apache.org/docs/latest/develop_tools/testing.html#running-tests) locally before make a pull request Closes #3093 from pan3793/SPNEGO. Closes #3093 4c05434f [Cheng Pan] Fix SPNEGO header Authored-by: Cheng Pan Signed-off-by: Cheng Pan --- .../apache/kyuubi/jdbc/hive/HttpKerberosRequestInterceptor.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/HttpKerberosRequestInterceptor.java b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/HttpKerberosRequestInterceptor.java index 13bbc551b..ce36cf37d 100644 --- a/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/HttpKerberosRequestInterceptor.java +++ b/kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/HttpKerberosRequestInterceptor.java @@ -64,7 +64,7 @@ public class HttpKerberosRequestInterceptor extends HttpRequestInterceptorBase { HttpAuthUtils.getKerberosServiceTicket(principal, host, loggedInSubject); // Set the session key token (Base64 encoded) in the headers httpRequest.addHeader( - HttpAuthUtils.AUTHORIZATION + ": " + HttpAuthUtils.NEGOTIATE + " ", kerberosAuthHeader); + HttpAuthUtils.AUTHORIZATION, HttpAuthUtils.NEGOTIATE + " " + kerberosAuthHeader); } catch (Exception e) { throw new HttpException(e.getMessage(), e); } finally {