@InterfaceStability.Evolving public class OAuthBearerValidatorCallback extends Object implements Callback
Callback
for use by the SaslServer
implementation when it
needs to provide an OAuth 2 bearer token compact serialization for
validation. Callback handlers should use the
error(String, String, String)
method to communicate errors back to
the SASL Client as per
RFC 6749: The OAuth
2.0 Authorization Framework and the IANA
OAuth Extensions Error Registry. 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.
Modifier and Type | Field and Description |
---|---|
protected io.confluent.kafka.util.ClientContext |
context |
Constructor and Description |
---|
OAuthBearerValidatorCallback(String tokenValue) |
OAuthBearerValidatorCallback(String tokenValue,
io.confluent.kafka.util.ClientContext context)
Constructor
|
public OAuthBearerValidatorCallback(String tokenValue, io.confluent.kafka.util.ClientContext context)
tokenValue
- the mandatory/non-blank token valuepublic OAuthBearerValidatorCallback(String tokenValue)
public io.confluent.kafka.util.ClientContext context()
public String tokenValue()
public OAuthBearerToken token()
public String errorStatus()
public String errorScope()
public String errorOpenIDConfiguration()
public void token(OAuthBearerToken token)
token
- the mandatory token to setpublic void error(String errorStatus, String errorScope, String errorOpenIDConfiguration)
errorStatus
- the mandatory error status value from the IANA
OAuth Extensions Error Registry to seterrorScope
- the optional error scope value to seterrorOpenIDConfiguration
- the optional error openid-configuration value to set