Class TokenBearerServerLoginCallbackHandler
java.lang.Object
io.confluent.kafka.server.plugins.auth.token.TokenBearerServerLoginCallbackHandler
- All Implemented Interfaces:
CallbackHandler,org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
public class TokenBearerServerLoginCallbackHandler
extends Object
implements org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
An abstract
CallbackHandler for the OAuthLoginModule.
There are two cases which must be covered with Token based authentication.
1. Inter-broker communication using Authentication Tokens
2. Inter-broker communication using another mechanism
Note: Inter-broker communication is not supported by this callback handler when running the token service on the same broker.
The first case will look almost exactly like the client login callback handler. SeeTokenBearerLoginCallbackHandler.
In the event the broker is not configured to use the OAuthLoginModule for inter-broker
communication it will return a null token.
With Inter-broker communication using Authentication Tokens
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule Required
metadataServerUrls="http://metadataServerUrls"
publicKeyPath="dir-to-pem-file"
username="broker"
password="broker"
Without Inter-broker communication using Authentication Tokens
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule Required
publicKeyPath="dir-to-pem-file"
This class should be explicitly set via the
listener.name.XXX.YYY.sasl.login.callback.handler.class configuration property
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
TokenBearerServerLoginCallbackHandler
public TokenBearerServerLoginCallbackHandler()
-
-
Method Details
-
configure
public void configure(Map<String, ?> configs, String saslMechanism, List<AppConfigurationEntry> jaasConfigEntries) - Specified by:
configurein interfaceorg.apache.kafka.common.security.auth.AuthenticateCallbackHandler
-
handle
- Specified by:
handlein interfaceCallbackHandler- Throws:
IOExceptionUnsupportedCallbackException
-
close
public void close()- Specified by:
closein interfaceorg.apache.kafka.common.security.auth.AuthenticateCallbackHandler
-
validatePublicKey
-