Table of Contents

Class GraphQlAuthorizationCodeOptions

Namespace
BpNexT.NET.GraphQL.Client.OAuth
Assembly
BpNexT.NET.GraphQL.dll

Options for creating a BpQlApplication that authenticates via the OAuth 2.0 authorization code flow with PKCE. At least one credential source must be set: an InitialTokens set from a completed login, a stored RefreshToken, microtech ERP user credentials (Username/Password plus RedirectUri), or a combination — the freshest source is used first and the credentials serve as self-healing fallback. Tokens are acquired lazily on first use; use the static BpQlApplication.*Async factories to authenticate eagerly (fail fast) or to log in interactively via the browser.

public sealed class GraphQlAuthorizationCodeOptions
Inheritance
object
GraphQlAuthorizationCodeOptions

Properties

ClientId

The OAuth client ID.

public required string ClientId { get; init; }

Property Value

string

ClientSecret

The client secret for confidential clients, or null for public clients.

public string? ClientSecret { get; init; }

Property Value

string

InitialTokens

A token set from a completed login (e.g. CompleteAsync(string, CancellationToken) in a consumer-hosted callback). Used directly; refreshed via its refresh token when it expires.

public GraphQlTokenSet? InitialTokens { get; init; }

Property Value

GraphQlTokenSet

OnTokensUpdated

Callback raised after every token acquisition; persist RefreshToken here (refresh tokens rotate).

public Action<GraphQlTokenSet>? OnTokensUpdated { get; init; }

Property Value

Action<GraphQlTokenSet>

Password

The microtech ERP password for the direct (Basic auth) login at the authorize endpoint.

public string? Password { get; init; }

Property Value

string

RedirectUri

The redirect URI registered for the client. Required with Username/Password; it is never visited.

public string? RedirectUri { get; init; }

Property Value

string

RefreshToken

A stored refresh token to resume a previous session.

public string? RefreshToken { get; init; }

Property Value

string

Username

The microtech ERP username for the direct (Basic auth) login at the authorize endpoint.

public string? Username { get; init; }

Property Value

string