Skip to content

[Doc] Update security-jwt.md to make client authentication #14136

@sakurafly123

Description

@sakurafly123

What issue do you find in Pulsar docs?

when client authentication using tokens based on JSON web Tokens, my client will throw following exceptions.

Exception in thread "main" org.apache.pulsar.client.api.PulsarClientException$AuthenticationException: Unable to authenticate
at org.apache.pulsar.client.api.PulsarClientException.unwrap(PulsarClientException.java:920)
at org.apache.pulsar.client.impl.ProducerBuilderImpl.create(ProducerBuilderImpl.java:94)
at PulsarProducerTest.main(PulsarProducerTest.java:30)
some modified propertiey in my standalone.conf

  • authenticationEnabled=true
  • authorizationEnabled=true
  • authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderToken
  • brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationToken
  • brokerClientAuthenticationParameters={"token":"xxx"}
  • tokenSecretKey=file:///path/to/secret.key

What is your suggestion?

we need to add a property named superUserRoles into broker.conf or standalone.conf and the value of superUserRoles is the role that we use to create token;

Do you have any references?

https://github.com/apache/pulsar/blob/master/site2/docs/security-jwt.md

Would you like to fix this issue?

yes

Note

  • I have researched my question.

Metadata

Metadata

Assignees

Labels

Staledoc-completeYour PR changes impact docs and the related docs have been already added.lifecycle/stale

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions