Table of Contents

Class ClientCredentialsAuth

Namespace
OpenShell.Oidc
Assembly
OpenShell.Sdk.dll

A renewable OAuth 2.0 client-credentials bearer provider. Tokens and secrets stay in memory; renewal is single-flight, proactive (30 s before expiry) and reactive (after Unauthenticated).

public sealed class ClientCredentialsAuth : IAuthProvider, IDisposable
Inheritance
ClientCredentialsAuth
Implements
Inherited Members

Properties

SendsCredentials

True when the provider attaches credentials, so transport safety checks apply.

public bool SendsCredentials { get; }

Property Value

bool

Methods

ApplyAsync(HttpRequestMessage, CancellationToken)

Adds authentication headers to an outgoing request.

public ValueTask ApplyAsync(HttpRequestMessage request, CancellationToken cancellationToken)

Parameters

request HttpRequestMessage
cancellationToken CancellationToken

Returns

ValueTask

Create(OidcOptions)

Creates a provider; configuration problems surface here, network problems on first use.

public static ClientCredentialsAuth Create(OidcOptions options)

Parameters

options OidcOptions

Returns

ClientCredentialsAuth

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.

TryRecoverAsync(CancellationToken)

Called after the gateway answered Unauthenticated. Returns true when credentials were renewed and the call is worth retrying once.

public ValueTask<bool> TryRecoverAsync(CancellationToken cancellationToken)

Parameters

cancellationToken CancellationToken

Returns

ValueTask<bool>