[ https://issues.apache.org/jira/browse/HIVE-25575?focusedWorklogId=736240&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-736240 ]
ASF GitHub Bot logged work on HIVE-25575: ----------------------------------------- Author: ASF GitHub Bot Created on: 03/Mar/22 19:05 Start Date: 03/Mar/22 19:05 Worklog Time Spent: 10m Work Description: sourabh912 commented on a change in pull request #3006: URL: https://github.com/apache/hive/pull/3006#discussion_r818979154 ########## File path: jdbc/src/java/org/apache/hive/jdbc/HiveConnection.java ########## @@ -804,6 +811,34 @@ protected boolean requestIsAborted(final HttpRequest request) { return httpClientBuilder.build(); } + private String getJWT() { + String jwtCredential = getJWTStringFromSession(); + if (jwtCredential == null) { + jwtCredential = getJWTStringFromEnv(); + } + return jwtCredential; + } + + private String getJWTStringFromEnv() { + String jwtCredential = System.getenv(JdbcConnectionParams.AUTH_JWT_ENV); + if (jwtCredential == null) { + LOG.debug("No JWT is specified in env variable {}", JdbcConnectionParams.AUTH_JWT_ENV); + } else { + LOG.debug("Fetched JWT from the env."); + } + return jwtCredential; + } + + private String getJWTStringFromSession() { + String jwtCredential = sessConfMap.get(JdbcConnectionParams.AUTH_TYPE_JWT_KEY); + if (jwtCredential == null) { + LOG.debug("No JWT is specified in connection string."); + } else { + LOG.debug("Fetched JWT from the session."); Review comment: IMO, it should be ok since the logging would be on the client side. @nrg4878 : Do you see any issue with it? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: gitbox-unsubscr...@hive.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org Issue Time Tracking ------------------- Worklog Id: (was: 736240) Time Spent: 2h (was: 1h 50m) > Add support for JWT authentication in HTTP mode > ----------------------------------------------- > > Key: HIVE-25575 > URL: https://issues.apache.org/jira/browse/HIVE-25575 > Project: Hive > Issue Type: New Feature > Components: HiveServer2, JDBC > Affects Versions: 4.0.0 > Reporter: Shubham Chaurasia > Assignee: Yu-Wen Lai > Priority: Major > Labels: pull-request-available > Time Spent: 2h > Remaining Estimate: 0h > > It would be good to support JWT auth mechanism in hive. In order to implement > it, we would need the following - > On HS2 side - > 1. Accept JWT in Authorization: Bearer header. > 2. Fetch JWKS from a public endpoint to verify JWT signature, to start with > we can fetch on HS2 start up. > 3. Verify JWT Signature. > On JDBC Client side - > 1. Hive jdbc client should be able to accept jwt in JDBC url. (will add more > details) > 2. Client should also be able to pick up JWT from an env var if it's defined. -- This message was sent by Atlassian Jira (v8.20.1#820001)