sijie commented on issue #6022: flink pulsar producer can not connect to 
cluster when enable Token Authentication
URL: https://github.com/apache/pulsar/issues/6022#issuecomment-574045209
 
 
   @saosir I would suggest not using 
   
   ```
   
clientConfigurationData.setAuthentication(AuthenticationFactory.token("eyJhbGciOiJIUzI1NiJ9.eyJzdWIiOiJtZW5zaGVuIn0.w7nsT2GDGmHPd8DchqUDQH27xQ84xJp5dGKaOMsC7oU"));
   ```
   
   since the authentication object will not be serialized correctly. 
   
   Use the client configuration data to pass in the token.
   
   ```
   val confData = new ClientConfigurationData()
       
confData.setAuthPluginClassName("org.apache.pulsar.client.impl.auth.AuthenticationToken")
       confData.setAuthParams("token:" + AUTH_TOKEN)
   
       val src: SourceFunction[String] =
         PulsarSourceBuilder
           .builder(new SimpleStringSchema())
           .pulsarAllClientConf(confData)
           .serviceUrl(SERVICE_URL)
           .topic(INPUT_TOPIC)
           .subscriptionName(SUBSCRIPTION_NAME)
           .build()
   ```

----------------------------------------------------------------
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:
us...@infra.apache.org


With regards,
Apache Git Services

Reply via email to