public class OAuthBearerLoginCallbackHandler extends Object implements org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
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 and Description |
---|
OAuthBearerLoginCallbackHandler() |
Modifier and Type | Method and Description |
---|---|
void |
close() |
void |
configure(Map<String,?> configs,
String saslMechanism,
List<AppConfigurationEntry> jaasConfigEntries) |
void |
handle(Callback[] callbacks) |
public void configure(Map<String,?> configs, String saslMechanism, List<AppConfigurationEntry> jaasConfigEntries)
configure
in interface org.apache.kafka.common.security.auth.AuthenticateCallbackHandler
public void handle(Callback[] callbacks) throws IOException, UnsupportedCallbackException
handle
in interface CallbackHandler
IOException
UnsupportedCallbackException
public void close()
close
in interface org.apache.kafka.common.security.auth.AuthenticateCallbackHandler