IWebAuthenticator.AuthenticateAsync(WebAuthenticatorOptions) 方法

定义

通过导航到指定的 URL 并等待回调/重定向到回调 URL 方案来开始身份验证流。

public:
 System::Threading::Tasks::Task<Microsoft::Maui::Authentication::WebAuthenticatorResult ^> ^ AuthenticateAsync(Microsoft::Maui::Authentication::WebAuthenticatorOptions ^ webAuthenticatorOptions);
public System.Threading.Tasks.Task<Microsoft.Maui.Authentication.WebAuthenticatorResult> AuthenticateAsync (Microsoft.Maui.Authentication.WebAuthenticatorOptions webAuthenticatorOptions);
abstract member AuthenticateAsync : Microsoft.Maui.Authentication.WebAuthenticatorOptions -> System.Threading.Tasks.Task<Microsoft.Maui.Authentication.WebAuthenticatorResult>
Public Function AuthenticateAsync (webAuthenticatorOptions As WebAuthenticatorOptions) As Task(Of WebAuthenticatorResult)

参数

webAuthenticatorOptions
WebAuthenticatorOptions

包含 WebAuthenticatorOptions 此身份验证调用的其他配置的实例。

返回

具有 WebAuthenticatorResult 此操作结果的对象。

例外

当用户取消身份验证流时引发。

Windows:发生 HTTP 请求错误时引发。

Windows:在收到意外的 HTTP 响应时引发。

iOS/macOS:使用 iOS 版本小于 13 或 macOS 小于 13.1 时引发。

Windows:在AppxManifest.xml文件中未注册回调自定义 URL 方案时引发。

Android:在为回调 URL 创建 No IntentFilter 时引发。

适用于