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
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
tokenSourceFunc<CancellationToken, ValueTask<string>>
Returns
CloudflareAccess(string, IAuthProvider?)
Adds Cloudflare Access credentials; any inner provider is applied first.
public static IAuthProvider CloudflareAccess(string edgeToken, IAuthProvider? inner = null)
Parameters
edgeTokenstringinnerIAuthProvider
Returns
StaticToken(string)
A fixed OIDC bearer token.
public static IAuthProvider StaticToken(string token)
Parameters
tokenstring
Returns
WithHeaders(IAuthProvider, IReadOnlyDictionary<string, string>)
Adds fixed headers on top of another provider.
public static IAuthProvider WithHeaders(IAuthProvider inner, IReadOnlyDictionary<string, string> headers)
Parameters
innerIAuthProviderheadersIReadOnlyDictionary<string, string>