AccountManager.ConfirmCredentials メソッド

定義

ユーザーがアカウントのパスワードを認識し、アカウントの所有者であることを確認します。

[Android.Runtime.Register("confirmCredentials", "(Landroid/accounts/Account;Landroid/os/Bundle;Landroid/app/Activity;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetConfirmCredentials_Landroid_accounts_Account_Landroid_os_Bundle_Landroid_app_Activity_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")]
[Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")]
public virtual Android.Accounts.IAccountManagerFuture? ConfirmCredentials (Android.Accounts.Account? account, Android.OS.Bundle? options, Android.App.Activity? activity, Android.Accounts.IAccountManagerCallback? callback, Android.OS.Handler? handler);
[<Android.Runtime.Register("confirmCredentials", "(Landroid/accounts/Account;Landroid/os/Bundle;Landroid/app/Activity;Landroid/accounts/AccountManagerCallback;Landroid/os/Handler;)Landroid/accounts/AccountManagerFuture;", "GetConfirmCredentials_Landroid_accounts_Account_Landroid_os_Bundle_Landroid_app_Activity_Landroid_accounts_AccountManagerCallback_Landroid_os_Handler_Handler")>]
[<Android.Runtime.RequiresPermission("android.permission.MANAGE_ACCOUNTS")>]
abstract member ConfirmCredentials : Android.Accounts.Account * Android.OS.Bundle * Android.App.Activity * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture
override this.ConfirmCredentials : Android.Accounts.Account * Android.OS.Bundle * Android.App.Activity * Android.Accounts.IAccountManagerCallback * Android.OS.Handler -> Android.Accounts.IAccountManagerFuture

パラメーター

account
Account

パスワードの知識を確認するアカウント

options
Bundle

要求の Authenticator 固有のオプション。文字列フィールドが存在する #KEY_PASSWORD 場合、認証子はユーザーにメッセージを表示するのではなく、直接使用できます。null または空の場合があります

activity
Activity

Activityユーザーにパスワードの入力を求める新しい認証子定義サブアクティビティを起動するために使用するコンテキスト。startActivity()を呼び出すためにのみ使用されます。null の場合、プロンプトは直接起動されませんが、代わりに必要なIntentが呼び出し元に返されます。

callback
IAccountManagerCallback

要求が完了したときに呼び出すコールバック。コールバックがない場合は null

handler
Handler

Handlerコールバック スレッドを識別する(メイン スレッドの場合は null)

戻り値

AccountManagerFutureアクティビティまたはパスワードが指定され、アカウントが正常に検証された場合に、これらのフィールドを使用してバンドルに解決される <。 ul><li>#KEY_ACCOUNT_NAME - アカウント検証 li><#KEY_ACCOUNT_TYPE の名前 - アカウント <li>#KEY_BOOLEAN_RESULT の種類 - 成功 </ul を示す true>

        If no activity or password was specified, the returned Bundle contains
        <code data-dev-comment-type="c">#KEY_INTENT</code> with the <code data-dev-comment-type="c">Intent</code> needed to launch the
        password prompt.

        &lt;p&gt;Also the returning Bundle may contain <code data-dev-comment-type="c">#KEY_LAST_AUTHENTICATED_TIME</code> indicating the last time the
        credential was validated/created.

        If an error occurred,<code data-dev-comment-type="c">AccountManagerFuture#getResult()</code> throws:
        &lt;ul&gt;
        &lt;li&gt; <code data-dev-comment-type="c">AuthenticatorException</code> if the authenticator failed to respond
        &lt;li&gt; <code data-dev-comment-type="c">OperationCanceledException</code> if the operation was canceled for
             any reason, including the user canceling the password prompt
        &lt;li&gt; <code data-dev-comment-type="c">IOException</code> if the authenticator experienced an I/O problem
             verifying the password, usually because of network trouble
        &lt;/ul&gt;
属性

注釈

ユーザーがアカウントのパスワードを認識し、アカウントの所有者であることを確認します。 ユーザーが入力したパスワードは直接指定できます。それ以外の場合は、このアカウントの種類の認証子が適切なインターフェイスをユーザーに求めます。 この方法は、追加の保証が必要なアプリケーションを対象としています。たとえば、電話ロック画面ではこれを使用して、ロック パターンを忘れた場合にユーザーがアカウント パスワードを使用して電話のロックを解除できるようにします。

ユーザーが入力したパスワードがこのアカウントの保存されたパスワードと一致する場合、要求は有効と見なされます。それ以外の場合、認証子はパスワードを確認します (通常はサーバーに接続します)。

このメソッドは、任意のスレッドから呼び出すこともできますが、返された AccountManagerFuture をメイン スレッドで使用することはできません。

<b>注:</b> API レベル 22 以前で動作するようにアプリをターゲットとする場合は、それらのプラットフォームMANAGE_ACCOUNTSアクセス許可が必要です。 API レベル 22 のこの関数のドキュメントを参照してください。

の Java ドキュメント android.accounts.AccountManager.confirmCredentials(android.accounts.Account, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler)

このページの一部は、によって作成および共有され、に記載されている条件に従って使用される作業に基づく変更です。

適用対象