Table of Contents

Class InteractiveBrowserLogin

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

Runs the full OAuth 2.0 authorization code flow with PKCE using the system browser and a loopback HTTP listener: opens the authorization page, waits for the redirect, validates the state, and exchanges the code for tokens.

public static class InteractiveBrowserLogin
Inheritance
object
InteractiveBrowserLogin

Methods

LoginAsync(InteractiveBrowserLoginOptions, HttpClient?, ILoggerFactory?, CancellationToken)

Performs the interactive login and returns the resulting token set. Wrap the result in an AuthorizationCodeTokenProvider for automatic caching and refresh.

public static Task<GraphQlTokenSet> LoginAsync(InteractiveBrowserLoginOptions options, HttpClient? httpClient = null, ILoggerFactory? loggerFactory = null, CancellationToken cancellationToken = default)

Parameters

options InteractiveBrowserLoginOptions

The login options.

httpClient HttpClient

Optional HTTP client used for the token exchange. When provided, its lifetime is owned by the caller.

loggerFactory ILoggerFactory

Optional logger factory. If null, SDK logging is disabled for this login.

cancellationToken CancellationToken

Token to cancel the login.

Returns

Task<GraphQlTokenSet>

Exceptions

GraphQlAuthenticationException

Thrown when the session is non-interactive, the user denied the request, the state check failed, the login timed out, or the code exchange was rejected.