confluent-kafka-dotnet
Show / Hide Table of Contents

Class ClientExtensions

IClient extension methods

Inheritance
object
ClientExtensions
Inherited Members
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.Kafka
Assembly: Confluent.Kafka.dll
Syntax
public static class ClientExtensions

Methods

OAuthBearerSetToken(IClient, string, long, 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

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.

long lifetimeMs

when the token expires, in terms of the number of milliseconds since the epoch.

string principalName

the mandatory Kafka principal name associated with the token.

IDictionary<string, 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)

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

string error

mandatory human readable error reason for failing to acquire a token.

See Also
OAuthBearerSetToken(IClient, string, long, string, IDictionary<string, string>)
In this article