confluent-kafka-dotnet
Show / Hide Table of Contents

Class BearerAuthenticationHeaderValueProvider

Provides bearer token authentication header values for schema registry requests based on OAuth2 client credentials flow.

Inheritance
object
AbstractBearerAuthenticationHeaderValueProvider
BearerAuthenticationHeaderValueProvider
Implements
IAuthenticationBearerHeaderValueProvider
IAuthenticationHeaderValueProvider
IDisposable
Inherited Members
AbstractBearerAuthenticationHeaderValueProvider.InitOrRefreshAsync()
AbstractBearerAuthenticationHeaderValueProvider.GetAuthenticationHeader()
AbstractBearerAuthenticationHeaderValueProvider.GetLogicalCluster()
AbstractBearerAuthenticationHeaderValueProvider.GetIdentityPool()
AbstractBearerAuthenticationHeaderValueProvider.Dispose()
object.Equals(object)
object.Equals(object, object)
object.GetHashCode()
object.GetType()
object.MemberwiseClone()
object.ReferenceEquals(object, object)
object.ToString()
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public class BearerAuthenticationHeaderValueProvider : AbstractBearerAuthenticationHeaderValueProvider, IAuthenticationBearerHeaderValueProvider, IAuthenticationHeaderValueProvider, IDisposable

Constructors

BearerAuthenticationHeaderValueProvider(HttpClient, string, string, string, string, string, string, int, int, int)

Initializes a new instance of the BearerAuthenticationHeaderValueProvider class.

Declaration
public BearerAuthenticationHeaderValueProvider(HttpClient httpClient, string clientId, string clientSecret, string scope, string tokenEndpoint, string logicalCluster, string identityPool, int maxRetries, int retriesWaitMs, int retriesMaxWaitMs)
Parameters
TypeNameDescription
HttpClienthttpClient

The HTTP client used for requests.

stringclientId

The OAuth client ID.

stringclientSecret

The OAuth client secret.

stringscope

The OAuth scope.

stringtokenEndpoint

The OAuth token endpoint URL.

stringlogicalCluster

The logical cluster name.

stringidentityPool

The identity pool.

intmaxRetries

The maximum number of retries.

intretriesWaitMs

The initial wait time between retries in milliseconds.

intretriesMaxWaitMs

The maximum wait time between retries in milliseconds.

Methods

CreateTokenRequest()

Creates an HTTP request message for token acquisition.

Declaration
protected override HttpRequestMessage CreateTokenRequest()
Returns
TypeDescription
HttpRequestMessage

An HTTP request message configured for token acquisition.

Overrides
AbstractBearerAuthenticationHeaderValueProvider.CreateTokenRequest()

DisposeSecrets()

Disposes of any sensitive information held by this provider.

Declaration
protected override void DisposeSecrets()
Overrides
AbstractBearerAuthenticationHeaderValueProvider.DisposeSecrets()

FetchToken(HttpRequestMessage)

Fetches a token using the provided reusable HTTP request message. Can also generate a new request if needed.

Declaration
protected override Task<string> FetchToken(HttpRequestMessage request)
Parameters
TypeNameDescription
HttpRequestMessagerequest

The HTTP request message to use for fetching the token.

Returns
TypeDescription
Task<string>

A task that represents the asynchronous operation. The task result contains the fetched token as a string.

Overrides
AbstractBearerAuthenticationHeaderValueProvider.FetchToken(HttpRequestMessage)

NeedsInitOrRefresh()

Declaration
public override bool NeedsInitOrRefresh()
Returns
TypeDescription
bool
Overrides
AbstractBearerAuthenticationHeaderValueProvider.NeedsInitOrRefresh()

Implements

IAuthenticationBearerHeaderValueProvider
IAuthenticationHeaderValueProvider
IDisposable
In this article