Package org.apache.kafka.common.security.oauthbearer
package org.apache.kafka.common.security.oauthbearer
Provides a
LoginModule
for using OAuth Bearer Token authentication with Kafka clusters.-
ClassDescription
BrokerJwtValidator
is an implementation ofJwtValidator
that is used by the broker to perform more extensive validation of the JWT access token that is received from the client, but ultimately from posting the client credentials to the OAuth/OIDC provider's token endpoint.ClientCredentialsJwtRetriever
is aJwtRetriever
that performs the steps to request a JWT from an OAuth/OIDC identity provider using theclient_credentials
grant type.ClientJwtValidator
is an implementation ofJwtValidator
that is used by the client to perform some rudimentary validation of the JWT access token that is received as part of the response from posting the client credentials to the OAuth/OIDC provider's token endpoint.DefaultJwtRetriever
instantiates and delegatesJwtRetriever
API calls to an embedded implementation based on configuration: If the value ofsasl.oauthbearer.token.endpoint.url
is set to a value that starts with thefile
protocol (e.g.ThisJwtValidator
uses the delegation approach, instantiating and delegating calls to a more concrete implementation.FileJwtRetriever
is anJwtRetriever
that will load the contents of a file, interpreting them as a JWT access key in the serialized form.JwtBearerJwtRetriever
is aJwtRetriever
that performs the steps to request a JWT from an OAuth/OIDC identity provider using theurn:ietf:params:oauth:grant-type:jwt-bearer
grant type.AJwtRetriever
is the internal API by which the login module will retrieve an access token for use in authorization by the broker.AJwtRetrieverException
is thrown in cases where the JWT cannot be retrieved.An instance ofJwtValidator
acts as a function object that, given an access token in base-64 encoded JWT format, can parse the data, perform validation, and construct anOAuthBearerToken
for use by the caller.AJwtValidatorException
is thrown in cases where the validity of a JWT cannot be determined.ACallback
for use by theSaslServer
implementation when it needs to validate the SASL extensions for the OAUTHBEARER mechanism Callback handlers should use theOAuthBearerExtensionsValidatorCallback.valid(String)
method to communicate valid extensions back to the SASL server.OAuthBearerLoginCallbackHandler
is anAuthenticateCallbackHandler
that acceptsOAuthBearerTokenCallback
andSaslExtensionsCallback
callbacks to perform the steps to request a JWT from an OAuth/OIDC provider using theclient_credentials
.TheLoginModule
for the SASL/OAUTHBEARER mechanism.Theb64token
value as defined in RFC 6750 Section 2.1 along with the token's specific scope and lifetime and principal name.ACallback
for use by theSaslClient
andLogin
implementations when they require an OAuth 2 bearer token.ACallback
for use by theSaslServer
implementation when it needs to provide an OAuth 2 bearer token compact serialization for validation.OAuthBearerValidatorCallbackHandler
is anAuthenticateCallbackHandler
that acceptsOAuthBearerValidatorCallback
andOAuthBearerExtensionsValidatorCallback
callbacks to implement OAuth/OIDC validation.