Table of Contents

Class OidcOptions

Namespace
OpenShell.Oidc
Assembly
OpenShell.Sdk.dll

Settings shared by every OIDC flow. Secrets are held in memory only and never logged.

public sealed record OidcOptions : IEquatable<OidcOptions>
Inheritance
OidcOptions
Implements
Inherited Members

Properties

Audience

Audience; null leaves it unset (or takes it from Gateway).

public string? Audience { get; init; }

Property Value

string

BrowserLauncher

Opens the authorization URL; defaults to the OS browser.

public Func<Uri, CancellationToken, ValueTask>? BrowserLauncher { get; init; }

Property Value

Func<Uri, CancellationToken, ValueTask>

CallbackPort

Loopback callback port; 0 tries 8000 then 18000 and falls back to the keyboard flow.

public int CallbackPort { get; init; }

Property Value

int

ClientId

OAuth client id. Filled from Gateway when omitted.

public string? ClientId { get; init; }

Property Value

string

ClientSecret

Client secret for confidential clients.

public string? ClientSecret { get; init; }

Property Value

string

ClientSecretProvider

Supplies the client secret on demand, so it need not live in configuration.

public Func<CancellationToken, ValueTask<string>>? ClientSecretProvider { get; init; }

Property Value

Func<CancellationToken, ValueTask<string>>

DisplayDeviceCode

Receives the verification URL and user code during the device flow; defaults to the console.

public Action<string, string>? DisplayDeviceCode { get; init; }

Property Value

Action<string, string>

Gateway

A registered gateway supplying issuer, client, audience, scopes and the token directory.

public GatewayMetadata? Gateway { get; init; }

Property Value

GatewayMetadata

HttpClient

HTTP client for discovery and token calls. It must not follow redirects. Defaults to a shared client that does not.

public HttpClient? HttpClient { get; init; }

Property Value

HttpClient

InMemory

Do not read or write the on-disk token cache.

public bool InMemory { get; init; }

Property Value

bool

Issuer

Issuer URL. Filled from Gateway when omitted.

public string? Issuer { get; init; }

Property Value

string

KeyboardInput

Input for the keyboard flow; defaults to standard input.

public TextReader? KeyboardInput { get; init; }

Property Value

TextReader

KeyboardOutput

Output for the keyboard flow; defaults to standard error.

public TextWriter? KeyboardOutput { get; init; }

Property Value

TextWriter

Scopes

Scopes. Interactive flows default to openid profile email; client credentials sends none unless set.

public IReadOnlyList<string>? Scopes { get; init; }

Property Value

IReadOnlyList<string>

TimeProvider

Clock for expiry and polling; defaults to System.

public TimeProvider? TimeProvider { get; init; }

Property Value

TimeProvider

Timeout

Overall timeout for a flow. Defaults to two minutes.

public TimeSpan Timeout { get; init; }

Property Value

TimeSpan

TokenCacheDirectory

Directory holding oidc_token.json; defaults to the gateway's per-user StateDirectory.

public string? TokenCacheDirectory { get; init; }

Property Value

string

UseKeyboardFlow

Use the paste-the-code flow instead of the browser callback.

public bool UseKeyboardFlow { get; init; }

Property Value

bool

Methods

ToString()

Returns a string that represents the current object.

public override string ToString()

Returns

string

A string that represents the current object.