-
Notifications
You must be signed in to change notification settings - Fork 3.7k
[client authentication] add authentication client with oauth2 support #7420
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
/pulsarbot run-failure-checks |
|
/pulsarbot run-failure-checks |
sijie
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
overall looks good! a small comment is to move the documentation to the website.
| @@ -0,0 +1,94 @@ | |||
| # Pulsar Client Authentication Plugin for OAuth 2.0 | |||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jiazhai Can you move this README to the website documentation?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
thanks @sijie, already marked it as doc-required. will provide another Pr to refine the doc.
### Motivation #7420 provides an Oauth2 auth client for java. This PR tries to support it in cpp client ### Modifications - add implementation - add related tests.
fixes #7425 ### Motivation Pulsar supports authenticating clients using OAuth 2.0 access tokens. the related code is updated as shown in this PR: #7420. Update the related pulsar doc. ### Modifications In security section: add Authentication using OAuth 2.0 access tokens Java client: add an example about Oauth authentication sidebar: update the sidebar document.
…#7420) ### Motivation Pulsar supports authenticating clients using OAuth 2.0 access tokens. You can use tokens to identify a Pulsar client and associate with some "principal" (or "role") that is permitted to do some actions (eg: publish to a topic or consume from a topic). This module is to support Pulsar Client Authentication Plugin for OAuth 2.0 directly. Client side communicate with Oauth 2.0 server, then the client will get an `access token` from Oauth 2.0 server, and will pass this `access token` to Pulsar broker to do the authentication. So the Broker side could still use `org.apache.pulsar.broker.authentication.AuthenticationProviderToken`, also user can add their own `AuthenticationProvider` to work with this module. ### Modifications - add related code; - add related test; - add related doc. The init of this client authentication module would be like: ```java Authentication oauth2Authentication = AuthenticationFactoryOAuth2.clientCredentials( new URL("https://dev-kt-aa9ne.us.auth0.com/oauth/token"), new URL("file:///path/to/credential/file.json"), // key file path "https://dev-kt-aa9ne.us.auth0.com/api/v2/" ); PulsarClient client = PulsarClient.builder() .serviceUrl("pulsar://broker.example.com:6650/") .authentication(oauth2Authentication) .build(); ``` ### Verifying this change tests passed. (cherry picked from commit 768813e)
fixes #7425 ### Motivation Pulsar supports authenticating clients using OAuth 2.0 access tokens. the related code is updated as shown in this PR: #7420. Update the related pulsar doc. ### Modifications In security section: add Authentication using OAuth 2.0 access tokens Java client: add an example about Oauth authentication sidebar: update the sidebar document. (cherry picked from commit 6726072)
…apache#7420) ### Motivation Pulsar supports authenticating clients using OAuth 2.0 access tokens. You can use tokens to identify a Pulsar client and associate with some "principal" (or "role") that is permitted to do some actions (eg: publish to a topic or consume from a topic). This module is to support Pulsar Client Authentication Plugin for OAuth 2.0 directly. Client side communicate with Oauth 2.0 server, then the client will get an `access token` from Oauth 2.0 server, and will pass this `access token` to Pulsar broker to do the authentication. So the Broker side could still use `org.apache.pulsar.broker.authentication.AuthenticationProviderToken`, also user can add their own `AuthenticationProvider` to work with this module. ### Modifications - add related code; - add related test; - add related doc. The init of this client authentication module would be like: ```java Authentication oauth2Authentication = AuthenticationFactoryOAuth2.clientCredentials( new URL("https://dev-kt-aa9ne.us.auth0.com/oauth/token"), new URL("file:///path/to/credential/file.json"), // key file path "https://dev-kt-aa9ne.us.auth0.com/api/v2/" ); PulsarClient client = PulsarClient.builder() .serviceUrl("pulsar://broker.example.com:6650/") .authentication(oauth2Authentication) .build(); ``` ### Verifying this change tests passed.
### Motivation apache#7420 provides an Oauth2 auth client for java. This PR tries to support it in cpp client ### Modifications - add implementation - add related tests.
fixes apache#7425 ### Motivation Pulsar supports authenticating clients using OAuth 2.0 access tokens. the related code is updated as shown in this PR: apache#7420. Update the related pulsar doc. ### Modifications In security section: add Authentication using OAuth 2.0 access tokens Java client: add an example about Oauth authentication sidebar: update the sidebar document.
Motivation
Pulsar supports authenticating clients using OAuth 2.0 access tokens. You can use tokens to identify a Pulsar client and associate with some "principal" (or "role") that is permitted to do some actions (eg: publish to a topic or consume from a topic).
This module is to support Pulsar Client Authentication Plugin for OAuth 2.0 directly. Client side communicate with Oauth 2.0 server, then the client will get an
access tokenfrom Oauth 2.0 server, and will pass thisaccess tokento Pulsar broker to do the authentication.So the Broker side could still use
org.apache.pulsar.broker.authentication.AuthenticationProviderToken,also user can add their own
AuthenticationProviderto work with this module.Modifications
The init of this client authentication module would be like:
Verifying this change
tests passed.