Skip to content

Commit

Permalink
[fix][broker] Call originalAuthState.authenticate in ServerCnx
Browse files Browse the repository at this point in the history
This change was introduced by #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)
  • Loading branch information
michaeljmarshall committed Feb 17, 2023
1 parent 0231ad3 commit 1935f07
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -847,10 +847,12 @@ protected void handleConnect(CommandConnect connect) {
+ " using auth method [%s] is not available", originalAuthMethod));
}

AuthData originalAuthDataCopy = AuthData.of(connect.getOriginalAuthData().getBytes());
originalAuthState = originalAuthenticationProvider.newAuthState(
AuthData.of(connect.getOriginalAuthData().getBytes()),
originalAuthDataCopy,
remoteAddress,
sslSession);
originalAuthState.authenticate(originalAuthDataCopy);
originalAuthData = originalAuthState.getAuthDataSource();
originalPrincipal = originalAuthState.getAuthRole();

Expand Down

0 comments on commit 1935f07

Please sign in to comment.