简体   繁体   中英

How to set Principal in Kafka console producer/consumer?

I want to experiment with ACL's in Kafka. So I have created some ACL's for a sample topic test in my Zookeeper which allows producer permission to User:Bob principal and consumer permission to User:Alice principal.

Now when I am using the kafka-console-producer or the consumer how do I mention the principal for this producer or consumer?

I tried setting a new config like principal=User:Bob inside the producer/consumer.properties file but it says it's an unrecognized config.

Can someone help me figure this out? Or Have I understood the idea of Principal wrong? Is it something to do with Kerberos based authentication?

Thanks in advance, Shabir

I was experimenting with the above scenario by means of following a blog and figured out that Principal here actually means the CN (Common Name) attribute of an SSL communication.

Kafka uses the CN of the communicating server's SSL certificate to identify the user and to do authentication and authorization accordingly.

Thus, there is no place to explicitly mention the principal when running the consumer or the producer . It is taken from the SSL certificate's CN attribute.

Thanks Shabir

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM