You are viewing a plain text version of this content. The canonical link for it is here.
Posted to jira@kafka.apache.org by GitBox <gi...@apache.org> on 2021/10/29 17:16:09 UTC

[GitHub] [kafka] junrao commented on a change in pull request #11443: KAFKA-13411: This code enforces the creation of the correct sasl client (OAuthBear…

junrao commented on a change in pull request #11443:
URL: https://github.com/apache/kafka/pull/11443#discussion_r739409165



##########
File path: clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.java
##########
@@ -216,7 +218,14 @@ SaslClient createSaslClient() {
                 String[] mechs = {mechanism};
                 log.debug("Creating SaslClient: client={};service={};serviceHostname={};mechs={}",
                     clientPrincipalName, servicePrincipal, host, Arrays.toString(mechs));
-                SaslClient retvalSaslClient = Sasl.createSaslClient(mechs, clientPrincipalName, servicePrincipal, host, configs, callbackHandler);
+                SaslClient retvalSaslClient = null;
+                if ("OAUTHBEARER".equalsIgnoreCase(mechanism)) {

Review comment:
       @shankarb27 : Thanks for the PR. Could you add some comments why this specialization is needed for only for OAUTHBEARER?

##########
File path: clients/src/main/java/org/apache/kafka/common/security/authenticator/SaslClientAuthenticator.java
##########
@@ -216,7 +218,14 @@ SaslClient createSaslClient() {
                 String[] mechs = {mechanism};
                 log.debug("Creating SaslClient: client={};service={};serviceHostname={};mechs={}",
                     clientPrincipalName, servicePrincipal, host, Arrays.toString(mechs));
-                SaslClient retvalSaslClient = Sasl.createSaslClient(mechs, clientPrincipalName, servicePrincipal, host, configs, callbackHandler);
+                SaslClient retvalSaslClient = null;
+                if ("OAUTHBEARER".equalsIgnoreCase(mechanism)) {

Review comment:
       @shankarb27 : Thanks for the PR. Could you add some comments on why this specialization is needed for only for OAUTHBEARER?




-- 
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: jira-unsubscribe@kafka.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org