Apache Kafka adding username and password SCRAM-SHA

1.4k Views Asked by At

I am currently using Kafka 2.6.0 I am trying to add SCRAM credential to zookeeper by following steps here: https://docs.confluent.io/platform/current/kafka/authentication_sasl/authentication_sasl_scram.html

However, the command

bin/kafka-configs --zookeeper localhost:2181 --alter --add-config 'SCRAM-SHA-256=[iterations=8192,password=alice-secret],SCRAM-SHA-512=[password=alice-secret]'
--entity-type users --entity-name Alice

returns below warning and successfully adds the credential for the user Alice

Warning: --zookeeper is deprecated and will be removed in a future version of Kafka.
Use --bootstrap-server instead to specify a broker to connect to.
Completed updating config for entity: user-principal 'Alice'

I have tried using bootstrap-server but getting this warning and does not add credential.

bin/kafka-configs --bootstrap-server localhost:9094 --alter --add-config 'SCRAM-SHA-256=[iterations=8192,password=alice-secret],SCRAM-SHA-512=[password=bob-secret]'
    --entity-type users --entity-name Bob
Only quota configs can be added for 'users' using --bootstrap-server. Unexpected config names: Set(SCRAM-SHA-512)

The Kafka Broker and Zookeeper are up and running and I can currently produce/consume messages successfully with Alice's credential. Is there a way to add SCRAM credentials in zookeeper using bootstrap-server?

0

There are 0 best solutions below