Interface AccessTokenValidator
- All Known Implementing Classes:
LoginAccessTokenValidator
,ValidatorAccessTokenValidator
public interface AccessTokenValidator
An instance of
AccessTokenValidator
acts as a function object that, given an access
token in base-64 encoded JWT format, can parse the data, perform validation, and construct an
OAuthBearerToken
for use by the caller.
The primary reason for this abstraction is that client and broker may have different libraries
available to them to perform these operations. Additionally, the exact steps for validation may
differ between implementations. To put this more concretely: the implementation in the Kafka
client does not have bundled a robust library to perform this logic, and it is not the
responsibility of the client to perform vigorous validation. However, the Kafka broker ships with
a richer set of library dependencies that can perform more substantial validation and is also
expected to perform a trust-but-verify test of the access token's signature.
See:
-
Method Summary
Modifier and TypeMethodDescriptionAccepts an OAuth JWT access token in base-64 encoded format, validates, and returns an OAuthBearerToken.
-
Method Details
-
validate
Accepts an OAuth JWT access token in base-64 encoded format, validates, and returns an OAuthBearerToken.- Parameters:
accessToken
- Non-null
JWT access token- Returns:
OAuthBearerToken
- Throws:
ValidateException
- Thrown on errors performing validation of given token
-