Class InteractiveBrowserLogin
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
-
objectInteractiveBrowserLogin
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
optionsInteractiveBrowserLoginOptionsThe login options.
httpClientHttpClientOptional HTTP client used for the token exchange. When provided, its lifetime is owned by the caller.
loggerFactoryILoggerFactoryOptional logger factory. If null, SDK logging is disabled for this login.
cancellationTokenCancellationTokenToken to cancel the login.
Returns
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.