共用方式為


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 建立 IntentFilter 時擲回。

適用於