Help Center/ MapReduce Service/ Developer Guide (LTS)/ Kafka Development Guide (Security Mode)/ Preparing the Kafka Application Development Environment/ Configuring Kafka Application Security Authentication/ Using SASL/PLAINTEXT Authentication
Updated on 2026-04-09 GMT+08:00
Using SASL/PLAINTEXT Authentication
Scenario
Kafka supports SASL/PLAINTEXT authentication for clusters with Kerberos authentication enabled.
Notes and Constraints
- This section applies to MRS 3.2.0 and later versions.
- If the current cluster version is MRS 3.2.0-LTS.1, ensure that MRS 3.2.0-LTS.1.5 or a later patch has been installed on the cluster.
Procedure
- Configure SASL/PLAINTEXT authentication on the Kafka server.
- Log in to FusionInsight Manager.
- Choose Cluster > Services > Kafka and choose Configurations > All Configurations. Search for sasl.enabled.mechanisms, change the value to GSSAPI,PLAIN, and click Save.
- Click Dashboard, click More, and select Restart Service to make the configuration take effect.
- Configure SASL/PLAINTEXT authentication on the Kafka client. You only need to configure dynamic jaas.conf and set related authentication attributes on the Kafka client. For details, see the authentication sample code in Producer of the com.huawei.bigdata.kafka.example.security package.
public static Properties initProperties() { ............ props.put("sasl.mechanism", "PLAIN"); props.put("sasl.jaas.config","org.apache.kafka.common.security.plain.PlainLoginModule required username=manager_user password=Password;"); }
- manager_user is a human-machine user created on FusionInsight Manager and must have the production and consumption permissions for the topic that is being used.
- Password is the password of manager_user. The password must comply with the regular expression .*[`~!=@#$%^&*()\\.\\-_+|\\[\\{\\}\\]:<>?/\\\\].*.
Parent topic: Configuring Kafka Application Security Authentication
What is your overall rating for this page?
0
1
2
3
4
5
6
7
8
9
10
Very dissatisfiedVery satisfied
Thank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
The system is busy. Please try again later.
For any further questions, feel free to contact us through the chatbot.
Chatbot