-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Polish docs for supported client authentication
See #95
- Loading branch information
Showing
2 changed files
with
99 additions
and
83 deletions.
There are no files selected for viewing
141 changes: 92 additions & 49 deletions
141
spring-pulsar-docs/src/main/asciidoc/authentication.adoc
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,91 +1,134 @@ | ||
[appendix] | ||
[[appendix.authentication]] | ||
= Authentication | ||
To connect to a Pulsar cluster requiring authentication, you need to set the `authPluginClassName` and any parameters required by the authentication plugin. The parameters can be set as a single JSON encoded string or as map of parameter names to parameter values. | ||
|
||
[[Athenz]] | ||
== Athenz | ||
==== | ||
[source, yaml] | ||
[source,yaml,indent=0,role="primary"] | ||
.[.small]#Map# | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationAthenz | ||
spring.pulsar.client.authentication.tenant-domain: ... | ||
spring.pulsar.client.authentication.tenant-service: ... | ||
spring.pulsar.client.authentication.provider-domain: ... | ||
spring.pulsar.client.authentication.private-key: ... | ||
spring.pulsar.client.authentication.private-key-path: ... | ||
spring.pulsar.client.authentication.key-id: ... | ||
spring.pulsar.client.authentication.auto-prefetch-enabled: ... | ||
spring.pulsar.client.authentication.athenz-conf-path: ... | ||
spring.pulsar.client.authentication.principal-header: ... | ||
spring.pulsar.client.authentication.role-header: ... | ||
spring.pulsar.client.authentication.zts-url: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2 | ||
authentication: | ||
issuer-url: https://auth.server.cloud/ | ||
private-key: file:///Users/some-key.json | ||
audience: urn:sn:acme:dev:my-instance | ||
---- | ||
.[.small]#JSON encoded string# | ||
[source,yaml,indent=0,role="secondary"] | ||
---- | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationOAuth2 | ||
auth-params: "{\"privateKey\":\"file:///Users/some-key.json\",\"issuerUrl\":\"https://auth.server.cloud/", \"audience\":\"urn:sn:acme:dev:my-instance"}" | ||
---- | ||
==== | ||
|
||
[[Basic]] | ||
== Basic | ||
TIP: Using a map is the recommended approach as it is less error-prone and easier to read | ||
|
||
The following shows how to configure each of the supported authentication mechanisms. | ||
|
||
[[Athenz]] | ||
.[.underline]#Click ##here## for **Athenz**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationBasic | ||
spring.pulsar.client.authentication.user-id: ... | ||
spring.pulsar.client.authentication.password: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationAthenz | ||
authentication: | ||
tenant-domain: ... | ||
tenant-service: ... | ||
provider-domain: ... | ||
private-key: ... | ||
key-id: ... | ||
enable-tls: true | ||
tls-trust-certs-file: /path/to/cacert.pem | ||
---- | ||
==== | ||
[[KeyStoreTls]] | ||
== KeyStoreTls | ||
[[Basic]] | ||
.[.underline]#Click ##here## for **Basic**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationKeyStoreTls | ||
spring.pulsar.client.authentication.key-store-type: ... | ||
spring.pulsar.client.authentication.key-store-path: ... | ||
spring.pulsar.client.authentication.key-store-password: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationBasic | ||
authentication: | ||
user-id: ... | ||
password: ... | ||
---- | ||
==== | ||
[[OAuth2]] | ||
== OAuth2 | ||
.[.underline]#Click ##here## for **OAuth2**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: ... | ||
spring.pulsar.client.authentication.issuer-url: ... | ||
spring.pulsar.client.authentication.private-key: ... | ||
spring.pulsar.client.authentication.audience: ... | ||
spring.pulsar.client.authentication.scope: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.oauth2.AuthenticationFactoryOAuth2 | ||
authentication: | ||
issuer-url: ... | ||
private-key: ... | ||
audience: ... | ||
scope: ... | ||
---- | ||
==== | ||
[[Sasl]] | ||
== Sasl | ||
.[.underline]#Click ##here## for **Sasl**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationSasl | ||
spring.pulsar.client.authentication.sasl-jaas-client-section-name: ... | ||
spring.pulsar.client.authentication.server-type: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationSasl | ||
authentication: | ||
sasl-jaas-client-section-name: ... | ||
server-type: ... | ||
---- | ||
==== | ||
[[Tls]] | ||
== Tls | ||
.[.underline]#Click ##here## for **Tls**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationTls | ||
spring.pulsar.client.authentication.tls-cert-file: ... | ||
spring.pulsar.client.authentication.tls-key-file: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationTls | ||
authentication: | ||
tls-cert-file: /path/to/my-role.cert.pem | ||
tls-key-file: /path/to/my-role.key-pk8.pem | ||
enable-tls: true | ||
tls-trust-certs-file: /path/to/cacert.pem | ||
---- | ||
==== | ||
[[Token]] | ||
== Token | ||
.[.underline]#Click ##here## for **Token**# | ||
[%collapsible] | ||
==== | ||
[source, yaml] | ||
---- | ||
spring.pulsar.client.auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationToken | ||
spring.pulsar.client.authentication.token: ... | ||
spring: | ||
pulsar: | ||
client: | ||
auth-plugin-class-name: org.apache.pulsar.client.impl.auth.AuthenticationToken | ||
authentication: | ||
token: some-token-goes-here | ||
---- | ||
==== | ||
==== | ||
NOTE: [.small]#More information on each of the schemes and their required properties can be found in the official link:https://pulsar.apache.org/docs/security-overview#authentication-providers[Pulsar security] documentation.# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters