@InterfaceStability.Evolving public class OAuthBearerTokenCallback extends Object implements Callback
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
.
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 InterfaceStability
annotation and this notice once the API
is considered stable.
Constructor and Description |
---|
OAuthBearerTokenCallback() |
Modifier and Type | Method and Description |
---|---|
void |
error(String errorCode,
String errorDescription,
String errorUri)
Set the error values as per
RFC 6749: The OAuth
2.0 Authorization Framework.
|
String |
errorCode()
Return the optional (but always non-empty if not null) error code as per
RFC 6749: The OAuth
2.0 Authorization Framework.
|
String |
errorDescription()
Return the (potentially null) error description as per
RFC 6749: The OAuth
2.0 Authorization Framework.
|
String |
errorUri()
Return the (potentially null) error URI as per
RFC 6749: The OAuth
2.0 Authorization Framework.
|
OAuthBearerToken |
token()
Return the (potentially null) token
|
void |
token(OAuthBearerToken token)
Set the token.
|
public OAuthBearerToken token()
public String errorCode()
public String errorDescription()
public String errorUri()
public void token(OAuthBearerToken token)
token
- the optional token to setpublic void error(String errorCode, String errorDescription, String errorUri)
errorCode
- the mandatory error code to seterrorDescription
- the optional error description to seterrorUri
- the optional error URI to set