Skip to content

Commit 6b1182c

Browse files
[fix][broker] Call originalAuthState.authenticate in ServerCnx
This change was introduced by apache#19295. That PR had more changes than are worth cherry-picking, though, so this commit only has the additional call to authenticate the original auth data. As a result, this commit is slightly less efficient because in some implementations, the authdata will be validated twice. (cherry picked from commit f9727ca) (cherry picked from commit 1935f07) (cherry picked from commit 870bf04)
1 parent 170772c commit 6b1182c

File tree

1 file changed

+3
-1
lines changed
  • pulsar-broker/src/main/java/org/apache/pulsar/broker/service

1 file changed

+3
-1
lines changed

pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -818,10 +818,12 @@ protected void handleConnect(CommandConnect connect) {
818818
+ " using auth method [%s] is not available", originalAuthMethod));
819819
}
820820

821+
AuthData originalAuthDataCopy = AuthData.of(connect.getOriginalAuthData().getBytes());
821822
originalAuthState = originalAuthenticationProvider.newAuthState(
822-
AuthData.of(connect.getOriginalAuthData().getBytes()),
823+
originalAuthDataCopy,
823824
remoteAddress,
824825
sslSession);
826+
originalAuthState.authenticate(originalAuthDataCopy);
825827
originalAuthData = originalAuthState.getAuthDataSource();
826828
originalPrincipal = originalAuthState.getAuthRole();
827829

0 commit comments

Comments
 (0)