Class BrokerJwtValidator
java.lang.Object
org.apache.kafka.common.security.oauthbearer.BrokerJwtValidator
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.security.oauthbearer.internals.secured.OAuthBearerConfigurable,JwtValidator
BrokerJwtValidator is an implementation of JwtValidator 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. The validation steps performed (primarily by the jose4j library) are:
- Basic structural validation of the
b64tokenvalue as defined in RFC 6750 Section 2.1 - Basic conversion of the token into an in-memory data structure
- Presence of
scope,exp,subject,iss, andiatclaims - Signature matching validation against the
kidand those provided by the OAuth/OIDC provider's JWKS
Nested Class Summary
Nested ClassesField Summary
Fields inherited from interface org.apache.kafka.common.security.oauthbearer.JwtValidator
IAT_CLAIM_REQUIRED, JTI_CLAIM_REQUIREDConstructor Summary
ConstructorsConstructorDescriptionA public, no-args constructor is necessary for instantiation via configuration.Method Summary
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.kafka.common.security.oauthbearer.internals.secured.OAuthBearerConfigurable
close
Constructor Details
BrokerJwtValidator
public BrokerJwtValidator()A public, no-args constructor is necessary for instantiation via configuration.
Method Details
configure
public void configure(Map<String, ?> configs, String saslMechanism, List<AppConfigurationEntry> jaasConfigEntries) - Specified by:
configurein interfaceorg.apache.kafka.common.security.oauthbearer.internals.secured.OAuthBearerConfigurable
validate
Accepts an OAuth JWT access token in base-64 encoded format, validates, and returns an OAuthBearerToken.- Specified by:
validatein interfaceJwtValidator- Parameters:
accessToken- Non-nullJWT access token- Returns:
OAuthBearerToken- Throws:
JwtValidatorException- Thrown on errors performing validation of given token