Package io.strimzi.kafka.oauth.common
Class FileBasedTokenProvider
java.lang.Object
io.strimzi.kafka.oauth.common.FileBasedTokenProvider
- All Implemented Interfaces:
TokenProvider
A TokenProvider that uses a file as a token source.
The content of the file is fully read and returned every time a
token() method is called.-
Constructor Summary
ConstructorsConstructorDescriptionFileBasedTokenProvider(String tokenFilePath) Create a new instance that refers to a specified file as a token source. -
Method Summary
-
Constructor Details
-
FileBasedTokenProvider
Create a new instance that refers to a specified file as a token source.- Parameters:
tokenFilePath- A path to a file containing a token- Throws:
IllegalArgumentException- if the specified tokenFilePath does not exist or is not a regular file
-
-
Method Details
-
token
Description copied from interface:TokenProviderGet a token- Specified by:
tokenin interfaceTokenProvider- Returns:
- A token
-
toString
-