turboFei commented on code in PR #6624:
URL: https://github.com/apache/kyuubi/pull/6624#discussion_r1720603305


##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/authentication/BearerAuthenticationHandler.scala:
##########
@@ -59,11 +61,23 @@ class BearerAuthenticationHandler(providerClass: String)
   }
 
   override def getAuthorization(request: HttpServletRequest): String = {
-    val authHeader = request.getHeader(AUTHORIZATION_HEADER)
-    if (allowAnonymous && (authHeader == null || authHeader.isEmpty)) {
-      ""
+    // Due to HIVE-22655, pass bearer token via a customized header for 
ThriftHttp protocol
+    var authHeader: String = request.getHeader(

Review Comment:
   I think you can keep it as it is



##########
kyuubi-server/src/main/scala/org/apache/kyuubi/server/http/ThriftHttpServlet.scala:
##########
@@ -287,7 +274,12 @@ class ThriftHttpServlet(
   }
 
   private def authenticate(request: HttpServletRequest, response: 
HttpServletResponse): String = {
-    val authorization = request.getHeader(AUTHORIZATION_HEADER)
+    // Due to HIVE-22655, pass bearer token via a customized header for 
ThriftHttp protocol
+    var authorization = request.getHeader(
+      conf.get(KyuubiConf.AUTHENTICATION_CUSTOM_HTTP_BEARER_HEADER))
+    if (authorization == null || authorization.isEmpty) {
+      authorization = request.getHeader(AUTHORIZATION_HEADER)
+    }

Review Comment:
   I think you can keep it as it is



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to