public abstract class AbstractTokenLoginCallbackHandler
extends java.lang.Object
implements org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
CallbackHandler
for the OAuthLoginModule.
There are three cases which must be covered with Token based authentication.
1. Kafka client-side User/Password credential authentication
2. Kafka client-side Token credential authentication
3. Kafka client impersonation.
All three circumstances can be handled through the use of two callback handlers.
TokenUserBearerLoginCallbackHandler
for User/Password credential authentication.
TokenBearerLoginCallbackHandler
for Token credential authentication.
Any application with an valid Authentication Token may impersonate another user making
TokenBearerLoginCallbackHandler
suitable for scenario 3 as well.
This abstract class handles the common functionality between them leaving the
specifics up to the individual implementations.
Implementations should be explicitly set via the
sasl.login.callback.handler.class
configuration property
Constructor and Description |
---|
AbstractTokenLoginCallbackHandler() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
abstract void |
configure(java.util.Map<java.lang.String,?> configs) |
void |
configure(java.util.Map<java.lang.String,?> configs,
java.lang.String saslMechanism,
java.util.List<javax.security.auth.login.AppConfigurationEntry> jaasConfigEntries) |
void |
handle(javax.security.auth.callback.Callback[] callbacks) |
public abstract void configure(java.util.Map<java.lang.String,?> configs)
public void configure(java.util.Map<java.lang.String,?> configs, java.lang.String saslMechanism, java.util.List<javax.security.auth.login.AppConfigurationEntry> jaasConfigEntries)
configure
in interface org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
public void handle(javax.security.auth.callback.Callback[] callbacks) throws java.io.IOException, javax.security.auth.callback.UnsupportedCallbackException
handle
in interface javax.security.auth.callback.CallbackHandler
java.io.IOException
javax.security.auth.callback.UnsupportedCallbackException
public void close()
close
in interface org.apache.kafka.common.security.auth.AuthenticateCallbackHandler