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