ivankelly commented on a change in pull request #2188: client configuration on 
authentication page is out of date
URL: https://github.com/apache/incubator-pulsar/pull/2188#discussion_r203432701
 
 

 ##########
 File path: site/docs/latest/security/authorization.md
 ##########
 @@ -74,36 +74,19 @@ needs to be able to publish to other clusters' topics.
 
 ## Pulsar admin authentication
 
-```java
-String authPluginClassName = "com.org.MyAuthPluginClass";
-String authParams = "param1:value1";
-boolean useTls = false;
-boolean tlsAllowInsecureConnection = false;
-String tlsTrustCertsFilePath = null;
-
-ClientConfiguration config = new ClientConfiguration();
-config.setAuthentication(authPluginClassName, authParams);
-config.setUseTls(useTls);
-config.setTlsAllowInsecureConnection(tlsAllowInsecureConnection);
-config.setTlsTrustCertsFilePath(tlsTrustCertsFilePath);
-
-PulsarAdmin admin = new PulsarAdmin(url, config);
-```
-
 To use TLS:
 
 ```java
+String url = "https://my-broker.example.com:8443";;
 String authPluginClassName = "com.org.MyAuthPluginClass";
 String authParams = "param1:value1";
-boolean useTls = false;
 boolean tlsAllowInsecureConnection = false;
-String tlsTrustCertsFilePath = null;
-
-ClientConfiguration config = new ClientConfiguration();
-config.setAuthentication(authPluginClassName, authParams);
-config.setUseTls(useTls);
-config.setTlsAllowInsecureConnection(tlsAllowInsecureConnection);
-config.setTlsTrustCertsFilePath(tlsTrustCertsFilePath);
-
-PulsarAdmin admin = new PulsarAdmin(url, config);
+String tlsTrustCertsFilePath = "/path/to/tls-trust-certs-file";
+
+PulsarAdmin admin = PulsarAdmin.builder()
+    .serviceHttpUrl(url) 
+    .authentication(authPluginClassName, authParams)
+    .allowTlsInsecureConnection(tlsAllowInsecureConnection)
 
 Review comment:
   this already defaults to false. Adding it here can be confusing.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to