Class OAuthBearerTokenCallback
- java.lang.Object
- 
- org.apache.kafka.common.security.oauthbearer.OAuthBearerTokenCallback
 
- 
- All Implemented Interfaces:
- Callback
 
 @Evolving public class OAuthBearerTokenCallback extends Object implements Callback ACallbackfor use by theSaslClientandLoginimplementations when they require an OAuth 2 bearer token. Callback handlers should use theerror(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 anIOException.This class was introduced in 2.0.0 and, while it feels stable, it could evolve. We will try to evolve the API in a compatible manner, but we reserve the right to make breaking changes in minor releases, if necessary. We will update the InterfaceStabilityannotation and this notice once the API is considered stable.
- 
- 
Constructor SummaryConstructors Constructor Description OAuthBearerTokenCallback()
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description voiderror(String errorCode, String errorDescription, String errorUri)Set the error values as per RFC 6749: The OAuth 2.0 Authorization Framework.StringerrorCode()Return the optional (but always non-empty if not null) error code as per RFC 6749: The OAuth 2.0 Authorization Framework.StringerrorDescription()Return the (potentially null) error description as per RFC 6749: The OAuth 2.0 Authorization Framework.StringerrorUri()Return the (potentially null) error URI as per RFC 6749: The OAuth 2.0 Authorization Framework.OAuthBearerTokentoken()Return the (potentially null) tokenvoidtoken(OAuthBearerToken token)Set the token.
 
- 
- 
- 
Method Detail- 
tokenpublic OAuthBearerToken token() Return the (potentially null) token- Returns:
- the (potentially null) token
 
 - 
errorCodepublic String 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
 
 - 
errorDescriptionpublic String errorDescription() Return the (potentially null) error description as per RFC 6749: The OAuth 2.0 Authorization Framework.- Returns:
- the (potentially null) error description
 
 - 
errorUripublic String errorUri() Return the (potentially null) error URI as per RFC 6749: The OAuth 2.0 Authorization Framework.- Returns:
- the (potentially null) error URI
 
 - 
tokenpublic void token(OAuthBearerToken token) Set the token. All error-related values are cleared.- Parameters:
- token- the optional token to set
 
 - 
errorpublic void error(String errorCode, String errorDescription, String errorUri) 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 set
- errorDescription- the optional error description to set
- errorUri- the optional error URI to set
 
 
- 
 
-