Liu-Junlin edited a comment on issue #4560: when authentication enabled 
pulsar-admin topics list will fail for nonpersistent topics
URL: https://github.com/apache/pulsar/issues/4560#issuecomment-513113595
 
 
   > To fix this issue, user need to provide settings of 
”brokerClientAuthenticationPlugin" and "brokerClientAuthenticationParameters“ 
in `broker.conf`
   @jiazhai 
   Could you tell me how to config this,please.
   I have done this by:
   
   1.config a token Authentication:
   
![image](https://user-images.githubusercontent.com/15389578/61514848-9ae0f980-aa33-11e9-8fc3-3a5bd9f54658.png)
   
**brokerClientAuthenticationPlugin=org.apache.pulsar.client.impl.auth.AuthenticationToken
   
brokerClientAuthenticationParameters=file:///data/pulsar/apache-pulsar/conf/secret.key**
   
   2.set a token when build admin client:
   
![image](https://user-images.githubusercontent.com/15389578/61514980-f1e6ce80-aa33-11e9-9abf-6e73283ede48.png)
   **PulsarAdmin.builder()
                   
.authentication("org.apache.pulsar.client.impl.auth.AuthenticationToken",token)
                   .serviceHttpUrl(pulsarProperties.getServiceUrl())
                   .build()**
   
   
   But the result  always return bad reques status,the pulsar broker server log 
is :
   `java.util.concurrent.ExecutionException: 
org.apache.pulsar.client.admin.PulsarAdminException: HTTP 400 Bad Request
        at 
java.util.concurrent.CompletableFuture.reportGet(CompletableFuture.java:357) 
~[?:1.8.0_202]
        at 
java.util.concurrent.CompletableFuture.get(CompletableFuture.java:1895) 
~[?:1.8.0_202]
        at 
org.apache.pulsar.broker.admin.v2.NonPersistentTopics.getList(NonPersistentTopics.java:184)
 ~[org.apache.pulsar-pulsar-broker-2.4.0.jar:2.4.0]
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_202]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_202]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_202]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_202]
        at `
   
[pulsar-broker-cloud-1.log](https://github.com/apache/pulsar/files/3409817/pulsar-broker-cloud-1.log)
   

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


With regards,
Apache Git Services

Reply via email to