Plain SASL set up is not working

We are configuring KAFAK with SASL_PLAINTEXT authentication but its not working as expected. I have gone though many documents and sites but no luck. It would be great if someone can check the configuration and help us what is the issue with setup.

listeners=SASL_PLAINTEXT://10.119.37.107:9093
sasl.enabled.mechanisms=SASL_PLAINTEXT
sasl.mechanism.inter.broker.protocol=SASL_PLAINTEXT
advertised.listeners=SASL_PLAINTEXT://10.119.37.107:9093
inter.broker.listener.name=SASL_PLAINTEXT
listener.security.protocol.map=SASL_PLAINTEXT:SASL_PLAINTEXT

followed below steps to start zookeeper and kafka server…

start zookeepr -

export KAFKA_OPTS=-Djava.security.auth.login.config=/opt/kafka/zookeeper_jaas.conf
./bin/zookeeper-server-start /opt/kafka/etc/kafka/zookeeper.properties

zookeeper.conf file ------

Server {
org.apache.kafka.common.security.plain.PlainLoginModule required
username="admin"
password="Admin*123"
user_admin="Admin*123";
};

Start Kafka Server -

export KAFKA_OPTS=-Djava.security.auth.login.config=/opt/kafka/kafka_server_jaas.conf
./bin/kafka-server-start /opt/kafka/etc/kafka/server.properties
Kafka_server_jass.conf

KafkaServer {
org.apache.kafka.common.security.plain.PlainLoginModule required
username=“admin”
password=“Admin123"
user_admin="Admin
123”;
};
Client {
org.apache.kafka.common.security.plain.PlainLoginModule required
username=“admin”
password=“Admin*123”;
};




Error message

Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to configure SaslClientAuthenticator
Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to create SaslClient with mechanism SASL_PLAINTEXT
[2022-09-27 11:56:43,248] INFO [Controller id=0, targetBrokerId=0] Client requested connection close from node 0 (org.apache.kafka.clients.NetworkClient)
[2022-09-27 11:56:43,284] INFO HV000001: Hibernate Validator 6.1.7.Final (org.hibernate.validator.internal.util.Version)
[2022-09-27 11:56:43,315] INFO [Consumer clientId=kafka-cruise-control, groupId=ConfluentTelemetryReporterSampler-8681863803997473173] Failed to create channel due to (org.apache.kafka.common.network.SaslChannelBuilder)
org.apache.kafka.common.errors.SaslAuthenticationException: Failed to configure SaslClientAuthenticator
Caused by: org.apache.kafka.common.errors.SaslAuthenticationException: Failed to create SaslClient with mechanism SASL_PLAINTEXT
[2022-09-27 11:56:43,315] WARN [Consumer clientId=kafka-cruise-control, groupId=ConfluentTelemetryReporterSampler-8681863803997473173] Error connecting to node 10.xxx.xx.xxx:9093 (id: -1 rack: null) (org.apache.kafka.clients.NetworkClient)
java.io.IOException: Channel could not be created for socket java.nio.channels.SocketChannel[closed]
at org.apache.kafka.common.network.Selector.buildAndAttachKafkaChannel(Selector.java:372)
at org.apache.kafka.common.network.Selector.registerChannel(Selector.java:353)
at org.apache.kafka.common.network.Selector.connect(Selector.java:280)
at org.apache.kafka.clients.NetworkClient.initiateConnect(NetworkClient.java:1108)
at org.apache.kafka.clients.NetworkClient.ready(NetworkClient.java:363)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.trySend(ConsumerNetworkClient.java:498)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:255)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:236)
at org.apache.kafka.clients.consumer.internals.ConsumerNetworkClient.poll(ConsumerNetworkClient.java:215)


It would be great help if you resolve this issue.

Hi Team,

i tried different options but no luck,. Can someone please suggest what is the issue with this setup.

Tried below options also no luck…


security.inter.broker.protocol=SASL_PLAINTEXT
sasl.enabled.mechanisms=PLAINTEXT
sasl.mechanism.inter.broker.protocol=PLAINTEXT
authorizer.class.name=kafka.security.authorizer.AclAuthorizer
allow.everyone.if.no.acl.found= true
auto.create.topic.enable= true