Class AbstractBearerAuthenticationHeaderValueProvider
Abstract base class for providers that supply Bearer authentication header values.
Inheritance
Inherited Members
Namespace: Confluent.SchemaRegistry
Assembly: Confluent.SchemaRegistry.dll
Syntax
public abstract class AbstractBearerAuthenticationHeaderValueProvider : IAuthenticationBearerHeaderValueProvider, IAuthenticationHeaderValueProvider, IDisposableConstructors
AbstractBearerAuthenticationHeaderValueProvider(string, string, int, int, int)
Initializes a new instance of the AbstractBearerAuthenticationHeaderValueProvider class.
Declaration
protected AbstractBearerAuthenticationHeaderValueProvider(string logicalCluster, string identityPool, int maxRetries, int retriesWaitMs, int retriesMaxWaitMs)Parameters
| Type | Name | Description |
|---|---|---|
| string | logicalCluster | The logical cluster name. |
| string | identityPool | The identity pool. |
| int | maxRetries | The maximum number of retries for token generation. |
| int | retriesWaitMs | The base wait time in milliseconds between retries. |
| int | retriesMaxWaitMs | The maximum wait time in milliseconds between retries. |
Methods
CreateTokenRequest()
Creates an HTTP request message for token acquisition.
Declaration
protected abstract HttpRequestMessage CreateTokenRequest()Returns
| Type | Description |
|---|---|
| HttpRequestMessage | An HTTP request message configured for token acquisition. |
Dispose()
Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
Declaration
public void Dispose()DisposeSecrets()
Disposes of any sensitive information held by this provider.
Declaration
protected virtual void DisposeSecrets()FetchToken(HttpRequestMessage)
Fetches a token using the provided reusable HTTP request message. Can also generate a new request if needed.
Declaration
protected abstract 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. |
GetAuthenticationHeader()
Get the authentication header for HTTP requests
Declaration
public AuthenticationHeaderValue GetAuthenticationHeader()Returns
| Type | Description |
|---|---|
| AuthenticationHeaderValue | The authentication header for HTTP request messages |
GetIdentityPool()
Get the identity pool for HTTP requests
Declaration
public string GetIdentityPool()Returns
| Type | Description |
|---|---|
| string | The identity pool for HTTP request messages |
GetLogicalCluster()
Get the logical cluster for HTTP requests
Declaration
public string GetLogicalCluster()Returns
| Type | Description |
|---|---|
| string | The logical cluster for HTTP request messages |
InitOrRefreshAsync()
Initializes or refreshes the authentication credentials.
Declaration
public Task InitOrRefreshAsync()Returns
| Type | Description |
|---|---|
| Task | A task representing the asynchronous initialization or refresh operation. |
NeedsInitOrRefresh()
Declaration
public abstract bool NeedsInitOrRefresh()Returns
| Type | Description |
|---|---|
| bool |