WebAuthenticationBroker exposes a unified authentication flow surface across supported backends.
WKWebView flow when the iOS backend is built with the .NET 8 Apple workload.AuthenticateAsync(Uri requestUri, Uri callbackUri, WebAuthenticationOptions options, CancellationToken cancellationToken)NoneSilentModeUseTitleUseHttpPostUseCorporateNetworkUseWebAuthenticationBroker| Field | Meaning |
|---|---|
ResponseStatus |
Success, UserCancel, or ErrorHttp. |
ResponseData |
Callback payload when available. |
ResponseErrorDetail |
Backend-specific error code when the status is ErrorHttp. |
ResponseData.SilentMode currently returns UserCancel across the runtime backends in this repo.UseHttpPost is currently unsupported on every runtime backend in this repo and returns ErrorHttp.http or https callback URL. Custom-scheme callbacks are not supported there.ErrorHttp instead of reporting a false user cancel.net8.0 contract assemblies.Use WebAuthenticationBroker when you need a callback-driven auth session. Use NativeWebDialog instead when you need a general-purpose desktop browser window.
Controller-level guards validate that:
http or https,javascript, data, file, about, or blob,UserInfo.using NativeWebView.Auth;
using NativeWebView.Core;
NativeWebViewRuntime.EnsureCurrentPlatformRegistered();
using var broker = new WebAuthenticationBroker();
var result = await broker.AuthenticateAsync(
new Uri("https://example.com/auth"),
new Uri("https://example.com/callback"),
WebAuthenticationOptions.None,
cancellationToken);