Class OAuthBearerLoginCallbackHandler
java.lang.Object
io.confluent.kafka.clients.plugins.auth.oauth.OAuthBearerLoginCallbackHandler
- All Implemented Interfaces:
CallbackHandler,org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
public class OAuthBearerLoginCallbackHandler
extends Object
implements org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
A
CallbackHandler that recognizes OAuthBearerTokenCallback
and retrieves OAuth 2 Bearer Token that was provided via the JAAS config.
It also attaches the (logical) cluster this token is allowed to work with as a SASL extension.
For example:
KafkaClient {
org.apache.kafka.common.security.oauthbearer.OAuthBearerLoginModule Required
token="Token"
cluster="audi"
};
This class should be explicitly set via the sasl.login.callback.handler.class
client configuration property.
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
OAuthBearerLoginCallbackHandler
public OAuthBearerLoginCallbackHandler()
-
-
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
-