From 4227b414e938d6ee9378cfb60ca291488d1d1ea2 Mon Sep 17 00:00:00 2001 From: rangao Date: Thu, 7 Dec 2023 11:52:38 +0800 Subject: [PATCH] fix --- .../java/org/apache/pulsar/broker/service/ServerCnx.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java index dab42b8e6d8f14..5fc79e61ca2e7c 100644 --- a/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java +++ b/pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java @@ -642,6 +642,10 @@ private void doAuthentication(AuthData clientData, String authRole = useOriginalAuthState ? originalPrincipal : this.authRole; AuthData brokerData = authState.authenticate(clientData); + if (log.isDebugEnabled()) { + log.debug("Authenticate using original auth state : {}, role = {}", useOriginalAuthState, authRole); + } + if (authState.isComplete()) { // Authentication has completed. It was either: // 1. the 1st time the authentication process was done, in which case we'll send @@ -650,11 +654,6 @@ private void doAuthentication(AuthData clientData, String newAuthRole = authState.getAuthRole(); - // Refresh the auth data. - if (log.isDebugEnabled()) { - log.debug("[{}] Auth data refreshed for role={}", remoteAddress, this.authRole); - } - AuthenticationDataSource newAuthDataSource = authState.getAuthDataSource(); if (state != State.Connected) { // First time authentication is done