confluent-kafka-dotnet
Show / Hide Table of Contents

Class AzureIMDSBearerAuthenticationHeaderValueProvider

Provider for authentication header values that uses Azure Instance Metadata Service (IMDS) to obtain bearer tokens.

Inheritance
object
AbstractBearerAuthenticationHeaderValueProvider
AzureIMDSBearerAuthenticationHeaderValueProvider
Implements
IAuthenticationBearerHeaderValueProvider
IAuthenticationHeaderValueProvider
IDisposable
Inherited Members
AbstractBearerAuthenticationHeaderValueProvider.InitOrRefreshAsync()
AbstractBearerAuthenticationHeaderValueProvider.GetAuthenticationHeader()
AbstractBearerAuthenticationHeaderValueProvider.GetLogicalCluster()
AbstractBearerAuthenticationHeaderValueProvider.GetIdentityPool()
AbstractBearerAuthenticationHeaderValueProvider.DisposeSecrets()
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 AzureIMDSBearerAuthenticationHeaderValueProvider : AbstractBearerAuthenticationHeaderValueProvider, IAuthenticationBearerHeaderValueProvider, IAuthenticationHeaderValueProvider, IDisposable

Constructors

AzureIMDSBearerAuthenticationHeaderValueProvider(HttpClient, string, string, string, int, int, int)

Initializes a new instance of the AzureIMDSBearerAuthenticationHeaderValueProvider class.

Declaration
public AzureIMDSBearerAuthenticationHeaderValueProvider(HttpClient httpClient, string tokenEndpoint, string logicalCluster, string identityPool, int maxRetries, int retriesWaitMs, int retriesMaxWaitMs)
Parameters
Type Name Description
HttpClient httpClient

The HTTP client used to make requests.

string tokenEndpoint

The endpoint URL to request tokens from.

string logicalCluster

The logical cluster name.

string identityPool

The identity pool identifier.

int maxRetries

The maximum number of retry attempts.

int retriesWaitMs

The initial wait time between retries in milliseconds.

int retriesMaxWaitMs

The maximum wait time between retries in milliseconds.

Methods

CreateTokenRequest()

Creates an HTTP request message for token acquisition.

Declaration
protected override HttpRequestMessage CreateTokenRequest()
Returns
Type Description
HttpRequestMessage

An HTTP request message configured for token acquisition.

Overrides
AbstractBearerAuthenticationHeaderValueProvider.CreateTokenRequest()

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
Type Name Description
HttpRequestMessage request

The HTTP request message to use for fetching the token.

Returns
Type Description
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
Type Description
bool
Overrides
AbstractBearerAuthenticationHeaderValueProvider.NeedsInitOrRefresh()

Implements

IAuthenticationBearerHeaderValueProvider
IAuthenticationHeaderValueProvider
IDisposable
In this article