0
0
Kafkadevops~10 mins

SASL authentication in Kafka - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to set the SASL mechanism to use SCRAM-SHA-256.

Kafka
props.put("sasl.mechanism", "[1]");
Drag options to blanks, or click blank then click option'
ASCRAM-SHA-256
BPLAIN
CGSSAPI
DOAUTHBEARER
Attempts:
3 left
💡 Hint
Common Mistakes
Using PLAIN instead of SCRAM-SHA-256
Misspelling the mechanism name
2fill in blank
medium

Complete the code to set the SASL JAAS config with username and password.

Kafka
props.put("sasl.jaas.config", "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"[1]\" password=\"secret\";");
Drag options to blanks, or click blank then click option'
Aadmin
Buser1
Cguest
Dkafka
Attempts:
3 left
💡 Hint
Common Mistakes
Using the wrong username
Forgetting to escape quotes properly
3fill in blank
hard

Fix the error in the SASL mechanism property key name.

Kafka
props.put("[1]", "SCRAM-SHA-512");
Drag options to blanks, or click blank then click option'
Asasl.mech
Bsasl.mechanisms
Csasl.mechanism
Dsasl.mechanism.name
Attempts:
3 left
💡 Hint
Common Mistakes
Using plural or incorrect property keys
Adding extra suffixes to the key
4fill in blank
hard

Fill both blanks to configure SASL with SCRAM-SHA-512 and set the username.

Kafka
props.put("sasl.mechanism", "[1]");
props.put("sasl.jaas.config", "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"[2]\" password=\"mypassword\";");
Drag options to blanks, or click blank then click option'
ASCRAM-SHA-512
BSCRAM-SHA-256
CkafkaUser
DadminUser
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing mechanism names
Using wrong usernames
5fill in blank
hard

Fill all three blanks to complete the SASL configuration with SCRAM-SHA-256, username, and password.

Kafka
props.put("sasl.mechanism", "[1]");
props.put("security.protocol", "[2]");
props.put("sasl.jaas.config", "org.apache.kafka.common.security.scram.ScramLoginModule required username=\"[3]\" password=\"pass123\";");
Drag options to blanks, or click blank then click option'
ASCRAM-SHA-512
BSASL_SSL
CkafkaUser
DSCRAM-SHA-256
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong security protocol
Confusing SCRAM-SHA-256 with SCRAM-SHA-512
Incorrect username