[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 <chengpan@apache.org>
Signed-off-by: Cheng Pan <chengpan@apache.org>
This commit is contained in:
Cheng Pan 2022-07-18 14:59:17 +08:00
parent 6999622420
commit 77b6ee0dca
No known key found for this signature in database
GPG Key ID: 8001952629BCC75D

View File

@ -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 {