Class TokenBearerLoginCallbackHandler
java.lang.Object
io.confluent.kafka.clients.plugins.auth.token.AbstractTokenLoginCallbackHandler
io.confluent.kafka.clients.plugins.auth.token.TokenBearerLoginCallbackHandler
- All Implemented Interfaces:
CallbackHandler,org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
A
CallbackHandler for the OAuthBearerLoginModule.
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.
TokenUserLoginCallbackHandler for User/Password credential authentication.
TokenBearerLoginCallbackHandler for Token credential authentication.
Any application with a valid Authentication Token may impersonate another user making
TokenBearerLoginCallbackHandler suitable for scenario 3 as well.
This class handles the token credential approach and can be configured as such.
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule Required
authenticationToken="long-token-string"
metadataServerUrls="https://mds:8080"
This class should be explicitly set via the
sasl.login.callback.handler.class configuration property-
Constructor Summary
Constructors -
Method Summary
Methods inherited from class io.confluent.kafka.clients.plugins.auth.token.AbstractTokenLoginCallbackHandler
configure, handle
-
Constructor Details
-
TokenBearerLoginCallbackHandler
public TokenBearerLoginCallbackHandler()
-
-
Method Details
-
configure
- Specified by:
configurein classAbstractTokenLoginCallbackHandler
-
close
public void close()- Specified by:
closein interfaceorg.apache.kafka.common.security.auth.AuthenticateCallbackHandler- Overrides:
closein classAbstractTokenLoginCallbackHandler
-
validateHaveCredentials
public void validateHaveCredentials(Map<String, String> moduleOptions, Map<String, throws org.apache.kafka.common.config.ConfigException?> configs) - Specified by:
validateHaveCredentialsin classAbstractTokenLoginCallbackHandler- Throws:
org.apache.kafka.common.config.ConfigException
-