Class FileTokenRetriever
java.lang.Object
org.apache.kafka.common.security.oauthbearer.secured.FileTokenRetriever
- All Implemented Interfaces:
Closeable
,AutoCloseable
,AccessTokenRetriever
,Initable
FileTokenRetriever
is an AccessTokenRetriever
that will load the contents,
interpreting them as a JWT access key in the serialized form.- See Also:
-
Constructor Details
-
FileTokenRetriever
-
-
Method Details
-
init
Description copied from interface:Initable
Lifecycle method to perform any one-time initialization of the retriever. This must be performed by the caller to ensure the correct state before methods are invoked.- Specified by:
init
in interfaceInitable
- Throws:
IOException
- Thrown on errors related to IO during initialization
-
retrieve
Description copied from interface:AccessTokenRetriever
Retrieves 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 theLoginModule
from which this is ultimately called does not provide an asynchronous approach.- Specified by:
retrieve
in interfaceAccessTokenRetriever
- Returns:
- Non-
null
JWT access token string - Throws:
IOException
- Thrown on errors related to IO during retrieval
-