Table of Contents

Class OidcLogin

Namespace
OpenShell.Oidc
Assembly
OpenShell.Sdk.dll

Entry points for the OIDC flows: interactive login, device login, refresh and client credentials.

public static class OidcLogin
Inheritance
OidcLogin
Inherited Members

Methods

ClientCredentialsAsync(OidcOptions, CancellationToken)

One-shot client-credentials exchange. A missing expires_in is tolerated here (the token has no expiry); use ClientCredentialsAuth for a renewable provider.

public static Task<OidcTokens> ClientCredentialsAsync(OidcOptions options, CancellationToken cancellationToken = default)

Parameters

options OidcOptions
cancellationToken CancellationToken

Returns

Task<OidcTokens>

DeviceLoginAsync(OidcOptions, CancellationToken)

RFC 8628 device-code login.

public static Task<OidcTokens> DeviceLoginAsync(OidcOptions options, CancellationToken cancellationToken = default)

Parameters

options OidcOptions
cancellationToken CancellationToken

Returns

Task<OidcTokens>

LoginAsync(OidcOptions, CancellationToken)

Authorization-code login with PKCE (when advertised). Opens a browser and listens on a loopback port, falling back to the paste-the-code flow. A valid cached token issued for the same issuer and client id is returned without any prompt.

public static Task<OidcTokens> LoginAsync(OidcOptions options, CancellationToken cancellationToken = default)

Parameters

options OidcOptions
cancellationToken CancellationToken

Returns

Task<OidcTokens>

RefreshAsync(OidcOptions, string, CancellationToken)

Exchanges a refresh token for new tokens. The response may omit a new refresh token; keep the old one then.

public static Task<OidcTokens> RefreshAsync(OidcOptions options, string refreshToken, CancellationToken cancellationToken = default)

Parameters

options OidcOptions
refreshToken string
cancellationToken CancellationToken

Returns

Task<OidcTokens>