CredentialManager.GetCredential 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
GetCredential(Context, GetCredentialRequest, CancellationSignal, IExecutor, IOutcomeReceiver)
啟動必要的流程,以從使用者擷取應用程式認證。
[Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void GetCredential (Android.Content.Context context, Android.Credentials.GetCredentialRequest request, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/GetCredentialRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.GetCredential : Android.Content.Context * Android.Credentials.GetCredentialRequest * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
參數
- context
- Context
用來啟動任何所需UI的內容;使用活動內容來確保UI將在相同的工作堆疊內啟動
- request
- GetCredentialRequest
指定要從使用者取得之認證類型的要求
- cancellationSignal
- CancellationSignal
允許取消此呼叫的選擇性訊號
- executor
- IExecutor
回呼將會在此進行 Executor
- callback
- IOutcomeReceiver
要求成功或失敗時叫用的回呼
- 屬性
備註
啟動必要的流程,以從使用者擷取應用程式認證。
執行可能會啟動UI流程,以收集使用者同意使用認證、在有多個認證存在時顯示選擇器等等。呼叫者(例如瀏覽器)可能會選擇性地為與自己的應用程式不同的來源設定來源 GetCredentialRequest
,以便代表該應用程式取得認證。 他們需要額外的許可權 CREDENTIAL_MANAGER_SET_ORIGIN
才能使用這項功能
此頁面的部分是根據 Android 開放原始碼專案所建立和共用的工作進行修改,並根據 Creative Commons 2.5 屬性授權中所述的詞彙使用。
適用於
GetCredential(Context, PrepareGetCredentialResponse+PendingGetCredentialHandle, CancellationSignal, IExecutor, IOutcomeReceiver)
[Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/PrepareGetCredentialResponse$PendingGetCredentialHandle;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void GetCredential (Android.Content.Context context, Android.Credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle pendingGetCredentialHandle, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("getCredential", "(Landroid/content/Context;Landroid/credentials/PrepareGetCredentialResponse$PendingGetCredentialHandle;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.GetCredential : Android.Content.Context * Android.Credentials.PrepareGetCredentialResponse.PendingGetCredentialHandle * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit
參數
- context
- Context
- pendingGetCredentialHandle
- PrepareGetCredentialResponse.PendingGetCredentialHandle
- cancellationSignal
- CancellationSignal
- executor
- IExecutor
- callback
- IOutcomeReceiver
- 屬性