0
0
Kafkadevops~20 mins

Client authentication configuration in Kafka - Practice Problems & Coding Challenges

Choose your learning style9 modes available
Challenge - 5 Problems
🎖️
Kafka Client Authentication Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
Predict Output
intermediate
2:00remaining
What is the output of this SASL/PLAIN client configuration?
Given the following Kafka client configuration snippet, what will be the SASL mechanism used when connecting?
Kafka
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="user1" password="pass1";
ASCRAM-SHA-256
BPLAIN
CGSSAPI
DOAUTHBEARER
Attempts:
2 left
💡 Hint
Look at the sasl.mechanism property to identify the authentication method.
Predict Output
intermediate
2:00remaining
What error occurs with this incomplete JAAS config?
Consider this Kafka client JAAS configuration snippet: sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="user1";
Kafka
security.protocol=SASL_SSL
sasl.mechanism=PLAIN
sasl.jaas.config=org.apache.kafka.common.security.plain.PlainLoginModule required username="user1";
AAuthentication fails due to missing password
BSyntaxError: missing password in JAAS config
CConnection succeeds with username only
DRuntimeException: Unknown SASL mechanism
Attempts:
2 left
💡 Hint
The PlainLoginModule requires both username and password.
🧠 Conceptual
advanced
2:00remaining
Which Kafka client property enables SSL client authentication?
To configure Kafka client for SSL client authentication (mutual TLS), which property must be set to provide the client's private key and certificate?
Assl.truststore.location
Bssl.enabled.protocols
Cssl.keystore.location
Dssl.client.auth
Attempts:
2 left
💡 Hint
The keystore contains the client's private key and certificate.
Predict Output
advanced
2:00remaining
What is the effect of this SASL/OAUTHBEARER config snippet?
Given this Kafka client configuration snippet: security.protocol=SASL_SSL sasl.mechanism=OAUTHBEARER sasl.login.callback.handler.class=org.apache.kafka.common.security.oauthbearer.secured.OAuthBearerLoginCallbackHandler sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;
Kafka
security.protocol=SASL_SSL
sasl.mechanism=OAUTHBEARER
sasl.login.callback.handler.class=org.apache.kafka.common.security.oauthbearer.secured.OAuthBearerLoginCallbackHandler
sasl.jaas.config=org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule required;
AClient fails due to missing OAuth token
BClient uses username/password authentication
CClient uses Kerberos ticket for authentication
DClient uses OAuth 2.0 token for authentication
Attempts:
2 left
💡 Hint
OAUTHBEARER mechanism uses OAuth 2.0 tokens.
🔧 Debug
expert
2:00remaining
Why does this Kafka client fail to authenticate with SCRAM?
This Kafka client configuration fails to authenticate: security.protocol=SASL_PLAINTEXT sasl.mechanism=SCRAM-SHA-256 sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="user1" password="pass1"; What is the most likely cause?
Kafka
security.protocol=SASL_PLAINTEXT
sasl.mechanism=SCRAM-SHA-256
sasl.jaas.config=org.apache.kafka.common.security.scram.ScramLoginModule required username="user1" password="pass1";
ABroker does not support SCRAM-SHA-256 mechanism
BMissing ssl.keystore.location property
CUsing SASL_PLAINTEXT instead of SASL_SSL causes failure
DIncorrect username format in JAAS config
Attempts:
2 left
💡 Hint
Check if the Kafka broker supports the SASL mechanism configured.