From 320daf872555dcfcf844f1c7b970eb10cd7d33b8 Mon Sep 17 00:00:00 2001 From: Zixuan Liu Date: Thu, 4 Aug 2022 15:15:41 +0800 Subject: [PATCH] [improve][doc] Add more configuration methods for basic authentication Signed-off-by: Zixuan Liu --- site2/docs/security-basic-auth.md | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/site2/docs/security-basic-auth.md b/site2/docs/security-basic-auth.md index 2585526bb478af..b151391f57161c 100644 --- a/site2/docs/security-basic-auth.md +++ b/site2/docs/security-basic-auth.md @@ -64,6 +64,12 @@ To configure brokers to authenticate clients, complete the following steps. authenticationEnabled=true authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderBasic + basicAuthConf=file:///path/to/.htpasswd + # basicAuthConf=/path/to/.htpasswd + # When use the base64 format, you need to encode the .htpaswd content to bas64 + # basicAuthConf=data:;base64,YOUR-BASE64 + # basicAuthConf=YOUR-BASE64 + # Authentication settings of the broker itself. Used when the broker connects to other brokers, either in same or other clusters brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationBasic brokerClientAuthenticationParameters={"userId":"superuser","password":"admin"} @@ -73,7 +79,9 @@ To configure brokers to authenticate clients, complete the following steps. authenticateOriginalAuthData=true ``` -2. Set an environment variable named `PULSAR_EXTRA_OPTS` and the value is `-Dpulsar.auth.basic.conf=/path/to/.htpasswd`. Pulsar reads this environment variable to implement HTTP basic authentication. + :::note + You can also set an environment variable named `PULSAR_EXTRA_OPTS` and the value is `-Dpulsar.auth.basic.conf=/path/to/.htpasswd`. Pulsar reads this environment variable to implement HTTP basic authentication. + ::: ## Enable basic authentication on proxies @@ -86,6 +94,12 @@ To configure proxies to authenticate clients, complete the following steps. authenticationEnabled=true authenticationProviders=org.apache.pulsar.broker.authentication.AuthenticationProviderBasic + basicAuthConf=file:///path/to/.htpasswd + # basicAuthConf=/path/to/.htpasswd + # When use the base64 format, you need to encode the .htpaswd content to bas64 + # basicAuthConf=data:;base64,YOUR-BASE64 + # basicAuthConf=YOUR-BASE64 + # For the proxy to connect to brokers brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationBasic brokerClientAuthenticationParameters={"userId":"superuser","password":"admin"} @@ -95,7 +109,11 @@ To configure proxies to authenticate clients, complete the following steps. forwardAuthorizationCredentials=true ``` -2. Set an environment variable named `PULSAR_EXTRA_OPTS` and the value is `-Dpulsar.auth.basic.conf=/path/to/.htpasswd`. Pulsar reads this environment variable to implement HTTP basic authentication. + :::note + + You can also set an environment variable named `PULSAR_EXTRA_OPTS` and the value is `-Dpulsar.auth.basic.conf=/path/to/.htpasswd`. Pulsar reads this environment variable to implement HTTP basic authentication. + + ::: ## Configure basic authentication in CLI tools