Kafka authentication via SASL/PLAIN with reloadable JAAS login configuration file.
PlainLoginModule based on org.apache.kafka.common.security.plain.PlainLoginModule which watches and reloads JAAS configuration file.
<dependency>
<groupId>com.github.grepplabs</groupId>
<artifactId>kafka-sasl-plain</artifactId>
<version>see above</version>
</dependency>
- download jar
mvn dependency:get \
-Dartifact=com.github.grepplabs:kafka-sasl-plain:1.0.0:jar \
-Dtransitive=false \
-Ddest="kafka-sasl-plain-1.0.0.jar"
- add jar to broker CLASSPATH by coping it to Kafka
libs
directory - modify JAAS configuration
kafka_server_jaas.conf:
KafkaServer {
com.grepplabs.kafka.security.sasl.plain.PlainLoginModule required
username="admin"
password="admin-secret"
user_admin="admin-secret"
user_alice="alice-secret";
};