You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Update logic behind AuthenticateOriginalAuthData to better support multiple authentication Providers #25071
I searched in the issues and found nothing similar.
Motivation
Currently if you utilize Pulsar Proxies, then to properly support JWT authentication and client disconnects after token expiry, one must enable authenticateOriginalAuthData on brokers.
If disabled, then connected clients with expired tokens can still produce/consume on topics as discussed in this issue #25062.
However, authenticateOriginalAuthData is not supported by Authentication methods like AuthenticationProviderTLS as the proxy performs a reencrypt of the TLS connection and therefore, authenticating the original principal always leads to the proxy identity which is not useful when authorizing.
Solution
AuthenticateOriginalAuthData can be made as a property of the AuthenticationProvider itself. With JWTs the original auth data must be authenticated, as otherwise connections will be kept open after token expiry. Therefore, it makes sense to include the property on the provider itself.
Terminate connections on Proxy if a token expires: I am not familiar with all the intricacies of how the proxy closes connections, but I do know that the Proxy does send a Disconnect to the client when it asserts the token to have expired. Therefore, if we can add a hook to the disconnect command, to close all proxied connections, we can get rid of authenticateOriginalAuthData completely.
Alternatives
No response
Anything else?
I am willing to work on this, however if solution 2 is possible, I would like a bit of help understanding the logic behind the proxy connections.
@shasank112001 We're focusing specifically on the case where bothforwardAuthorizationCredentials and authenticateOriginalAuthData are set to true.
The issue is: if either of these is disabled, the broker won't properly handle token expiration, meaning expired client connections won't be closed as expected.
Activity
nodece commentedon Jan 20, 2026
@shasank112001 We're focusing specifically on the case where both
forwardAuthorizationCredentialsandauthenticateOriginalAuthDataare set totrue.The issue is: if either of these is disabled, the broker won't properly handle token expiration, meaning expired client connections won't be closed as expected.
The current proxy implementation:
pulsar/pulsar-proxy/src/main/java/org/apache/pulsar/proxy/server/ProxyConnection.java
Lines 522 to 525 in 1050f48
Which assumes the broker will always validate token expiration. However:
authenticateOriginalAuthData=false: The broker only validates the proxy's credentials, not the original client's tokenA workaround: So both settings must be enabled together for proper token expiration handling through the broker and proxy.
I will open a PR to fix this issue.