Class DefaultJwtRetriever
java.lang.Object
org.apache.kafka.common.security.oauthbearer.DefaultJwtRetriever
- All Implemented Interfaces:
Closeable,AutoCloseable,org.apache.kafka.common.security.oauthbearer.internals.secured.OAuthBearerConfigurable,JwtRetriever
DefaultJwtRetriever instantiates and delegates JwtRetriever API calls to an embedded implementation
based on configuration:
-
If the value of
sasl.oauthbearer.token.endpoint.urlis set to a value that starts with thefileprotocol (e.g.file:/tmp/path/to/a/static-jwt.json), an instance ofFileJwtRetrieverwill be used as the underlyingJwtRetriever. Otherwise, the URL is assumed to be an HTTP/HTTPS-based URL, and an instance ofClientAssertionRequestFormatterorClientSecretRequestFormatterwill be created and used.
JwtRetriever classes will likely differ. Please refer to the
official Apache Kafka documentation for more information on these, and related configuration.-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
DefaultJwtRetriever
public DefaultJwtRetriever()
-
-
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
-
retrieve
Description copied from interface:JwtRetrieverRetrieves a JWT access token in its serialized three-part form. The implementation is free to determine how it should be retrieved but should not perform validation on the result. Note: This is a blocking function and callers should be aware that the implementation may be communicating over a network, with the file system, coordinating threads, etc. The facility in theLoginModulefrom which this is ultimately called does not provide an asynchronous approach.- Specified by:
retrievein interfaceJwtRetriever- Returns:
- Non-
nullJWT access token string - Throws:
JwtRetrieverException- Thrown on errors related to IO during retrieval
-
close
- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable- Specified by:
closein interfaceorg.apache.kafka.common.security.oauthbearer.internals.secured.OAuthBearerConfigurable- Throws:
IOException
-