[Bug] Multi-role does not forbid user if proxy superuser
Author: gulecrocCreated Jun 12, 2025Updated Oct 1, 2026
Labelstype/bugtriage/lhotari/important
Search before reporting
- I searched in the issues and found nothing similar.
Read release policy
- I understand that unsupported versions don't get bug fixes. I will attempt to reproduce the issue on a supported version of Pulsar client and Pulsar broker.
User environment
Cluster deployed with Apache Pulsar Helm Chart master (v4.2.0) Broker version : 4.0.5
Issue Description
The proxy and broker are configured with Openid authentification :
authenticationEnabled: "true"
authenticationProviders: org.apache.pulsar.broker.authentication.oidc.AuthenticationProviderOpenID
PULSAR_PREFIX_openIDAllowedAudiences: pulsar-au
PULSAR_PREFIX_openIDAllowedTokenIssuers: https://token.issuer.com
PULSAR_PREFIX_openIDRoleClaim: scopeThe proxy and broker are configured with Oauth2 client authentication :
brokerClientAuthenticationParameters: '{"privateKey":"file:///pulsar/auth/<component>/credentials_file.json","audience":"pulsar-aud","issuerUrl":"https://token.issuer.com","scope":"pulsar-<component>"}'
brokerClientAuthenticationPlugin: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2Broker authorization config :
authorizationEnabled: "true"
tokenAuthClaim: scope
superUserRoles: pulsar-broker,pulsar-proxy
proxyRoles: pulsar-proxyI create 2 topics :
tenant1/ns1/topic1with permissionsproduce/consumefor rolerole1tenant2/ns2/topic2with permissionsproduce/consumefor rolerole2
When the broker authorizationProvider is the default, my client with role role1 can produce only to tenant1/ns1/topic1.
But when I set broker authorizationProvider=org.apache.pulsar.broker.authorization.MultiRolesTokenAuthorizationProvider, my client with role1 can produce to both topics. I don't know if it's due to proxy superuser role ?
I don't know how to test it in MultiRolesTokenAuthorizationProviderTest ?
Error messages
Reproducing the issue
See previous
Additional information
No response
Are you willing to submit a PR?
- I'm willing to submit a PR!
Source: apache/pulsar