Class ClientExtensions
IClient extension methods
Inheritance
Inherited Members
Namespace: Confluent.Kafka
Assembly: cs.temp.dll.dll
Syntax
public static class ClientExtensions
Methods
OAuthBearerSetToken(IClient, String, Int64, String, IDictionary<String, String>)
Set SASL/OAUTHBEARER token and metadata.
The SASL/OAUTHBEARER token refresh callback or
event handler should invoke this method upon
success. The extension keys must not include
the reserved key "auth
", and all extension
keys and values must conform to the required
format as per https://tools.ietf.org/html/rfc7628#section-3.1:
Declaration
public static void OAuthBearerSetToken(this IClient client, string tokenValue, long lifetimeMs, string principalName, IDictionary<string, string> extensions = null)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | the instance of a IClient |
System.String | tokenValue | the mandatory token value to set, often (but not necessarily) a JWS compact serialization as per https://tools.ietf.org/html/rfc7515#section-3.1. |
System.Int64 | lifetimeMs | when the token expires, in terms of the number of milliseconds since the epoch. |
System.String | principalName | the mandatory Kafka principal name associated with the token. |
System.Collections.Generic.IDictionary<System.String, System.String> | extensions | optional SASL extensions dictionary, to be communicated to the broker as additional key-value pairs during the initial client response as per https://tools.ietf.org/html/rfc7628#section-3.1. |
See Also
OAuthBearerSetTokenFailure(IClient, String)
SASL/OAUTHBEARER token refresh failure indicator. The SASL/OAUTHBEARER token refresh callback or event handler should invoke this method upon failure.
Declaration
public static void OAuthBearerSetTokenFailure(this IClient client, string error)
Parameters
Type | Name | Description |
---|---|---|
IClient | client | the instance of a IClient |
System.String | error | mandatory human readable error reason for failing to acquire a token. |