共用方式為


CredentialManager.GetCredential 方法

定義

多載

GetCredential(Context, GetCredentialRequest, CancellationSignal, IExecutor, IOutcomeReceiver)

啟動必要的流程,以從使用者擷取應用程式認證。

GetCredential(Context, PrepareGetCredentialResponse+PendingGetCredentialHandle, CancellationSignal, IExecutor, IOutcomeReceiver)

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.credentials.CredentialManager.getCredential(android.content.Context, android.credentials.GetCredentialRequest, android.os.CancellationSignal, java.util.concurrent.Executor, android.os.OutcomeReceiver<android.credentials.GetCredentialResponse, android.credentials.GetCredentialException>)Java 檔。

此頁面的部分是根據 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
cancellationSignal
CancellationSignal
executor
IExecutor
callback
IOutcomeReceiver
屬性

適用於