Class LdapAuthenticateCallbackHandler

java.lang.Object
io.confluent.security.auth.provider.ldap.LdapAuthenticateCallbackHandler
All Implemented Interfaces:
Closeable, AutoCloseable, CallbackHandler, org.apache.kafka.common.security.auth.AuthenticateCallbackHandler, org.apache.kafka.common.security.auth.AuthorizationIdProvider

public class LdapAuthenticateCallbackHandler extends Object implements org.apache.kafka.common.security.auth.AuthorizationIdProvider, org.apache.kafka.common.security.auth.AuthenticateCallbackHandler, Closeable
LDAP authentication callback handler that can be used for simple username/password authentication. Authentication may be performed using one of the following modes:
  • Use broker's LDAP credentials to obtain DN for username and bind using (userDn, password). This will be an anonymous search if broker is not configured with credentials.
  • Use broker's LDAP credentials to obtain (possibly encrypted) password for username and compare passwords.
This is currently used for BASIC authentication in REST servers. It is also designed to be used for SASL/PLAIN authentication using LDAP for Kafka clients, but we need to propagate custom configs to callback handlers for enabling that. NOTE: Any AuthenticationException thrown by the callback handler should not leak information.