Class OAuthBearerTokenCallback
java.lang.Object
org.apache.kafka.common.security.oauthbearer.OAuthBearerTokenCallback
- All Implemented Interfaces:
Callback
A
Callback for use by the SaslClient and Login implementations when they require an OAuth 2 bearer token. Callback handlers should use the error(String, String, String) method to communicate errors returned by the authorization server as per RFC 6749: The OAuth 2.0 Authorization Framework. Callback handlers should communicate other problems by raising an IOException.Constructor Summary
ConstructorsMethod Summary
Modifier and TypeMethodDescriptionvoidSet the error values as per RFC 6749: The OAuth 2.0 Authorization Framework.Return the optional (but always non-empty if not null) error code as per RFC 6749: The OAuth 2.0 Authorization Framework.Return the (potentially null) error description as per RFC 6749: The OAuth 2.0 Authorization Framework.errorUri()Return the (potentially null) error URI as per RFC 6749: The OAuth 2.0 Authorization Framework.token()Return the (potentially null) tokenvoidtoken(OAuthBearerToken token) Set the token.
Constructor Details
OAuthBearerTokenCallback
public OAuthBearerTokenCallback()
Method Details
token
Return the (potentially null) token- Returns:
- the (potentially null) token
errorCode
Return the optional (but always non-empty if not null) error code as per RFC 6749: The OAuth 2.0 Authorization Framework.- Returns:
- the optional (but always non-empty if not null) error code
errorDescription
Return the (potentially null) error description as per RFC 6749: The OAuth 2.0 Authorization Framework.- Returns:
- the (potentially null) error description
errorUri
Return the (potentially null) error URI as per RFC 6749: The OAuth 2.0 Authorization Framework.- Returns:
- the (potentially null) error URI
token
Set the token. All error-related values are cleared.- Parameters:
token- the optional token to set
error
Set the error values as per RFC 6749: The OAuth 2.0 Authorization Framework. Any token is cleared.- Parameters:
errorCode- the mandatory error code to seterrorDescription- the optional error description to seterrorUri- the optional error URI to set