Table of Contents

Class Auth

Namespace
OpenShell
Assembly
OpenShell.Sdk.dll

Factory methods for the built-in IAuthProvider implementations.

public static class Auth
Inheritance
Auth
Inherited Members

Properties

None

No credentials.

public static IAuthProvider None { get; }

Property Value

IAuthProvider

Methods

Bearer(Func<CancellationToken, ValueTask<string>>)

A bearer token fetched per request, for example from a cache that renews itself.

public static IAuthProvider Bearer(Func<CancellationToken, ValueTask<string>> tokenSource)

Parameters

tokenSource Func<CancellationToken, ValueTask<string>>

Returns

IAuthProvider

CloudflareAccess(string, IAuthProvider?)

Adds Cloudflare Access credentials; any inner provider is applied first.

public static IAuthProvider CloudflareAccess(string edgeToken, IAuthProvider? inner = null)

Parameters

edgeToken string
inner IAuthProvider

Returns

IAuthProvider

StaticToken(string)

A fixed OIDC bearer token.

public static IAuthProvider StaticToken(string token)

Parameters

token string

Returns

IAuthProvider

WithHeaders(IAuthProvider, IReadOnlyDictionary<string, string>)

Adds fixed headers on top of another provider.

public static IAuthProvider WithHeaders(IAuthProvider inner, IReadOnlyDictionary<string, string> headers)

Parameters

inner IAuthProvider
headers IReadOnlyDictionary<string, string>

Returns

IAuthProvider