Skip to content

Commit 870bf04

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)
1 parent 3e90bc2 commit 870bf04

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
@@ -846,10 +846,12 @@ protected void handleConnect(CommandConnect connect) {
846846
+ " using auth method [%s] is not available", originalAuthMethod));
847847
}
848848

849+
AuthData originalAuthDataCopy = AuthData.of(connect.getOriginalAuthData().getBytes());
849850
originalAuthState = originalAuthenticationProvider.newAuthState(
850-
AuthData.of(connect.getOriginalAuthData().getBytes()),
851+
originalAuthDataCopy,
851852
remoteAddress,
852853
sslSession);
854+
originalAuthState.authenticate(originalAuthDataCopy);
853855
originalAuthData = originalAuthState.getAuthDataSource();
854856
originalPrincipal = originalAuthState.getAuthRole();
855857

0 commit comments

Comments
 (0)