pan3793 commented on code in PR #5961:
URL: https://github.com/apache/kyuubi/pull/5961#discussion_r1449719052


##########
kyuubi-hive-jdbc/src/main/java/org/apache/kyuubi/jdbc/hive/KyuubiConnection.java:
##########
@@ -861,7 +861,9 @@ && hasSessionValue(AUTH_PRINCIPAL)
         && !hasSessionValue(AUTH_KYUUBI_CLIENT_KEYTAB)
         && (AUTH_KERBEROS_AUTH_TYPE_FROM_SUBJECT.equalsIgnoreCase(
                 sessConfMap.get(AUTH_KERBEROS_AUTH_TYPE))
-            || isHadoopUserGroupInformationDoAs());
+            || (!AUTH_KERBEROS_AUTH_TYPE_FROM_TICKET_CACHE.equalsIgnoreCase(
+                    sessConfMap.get(AUTH_KERBEROS_AUTH_TYPE))
+                && isHadoopUserGroupInformationDoAs()));

Review Comment:
   if so, I suggest changing it to
   
   (I use string literal in the example, please replace them with const 
variable)
   ```java
     private boolean isForciblyFromSubjectAuthMode() {
       return 
"fromSubject".equalsIgnoreCase(sessConfMap.get("kerberosAuthType"));
     }
   
     private boolean isForciblyTgtCacheAuthMode() {
       return 
"fromTicketCache".equalsIgnoreCase(sessConfMap.get("kerberosAuthType"));
     }
   
     ...
   
     private boolean isFromSubjectAuthMode() {
       return isSaslAuthMode()
           && hasSessionValue(AUTH_PRINCIPAL)
           && !hasSessionValue(AUTH_KYUUBI_CLIENT_PRINCIPAL)
           && !hasSessionValue(AUTH_KYUUBI_CLIENT_KEYTAB)
           && !isForciblyTgtCacheAuthMode()
           && (isForciblyFromSubjectAuthMode() || 
isHadoopUserGroupInformationDoAs());
     }
   
   ```



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