AccountManager.BlockingGetAuthToken(Account, String, Boolean) Method

Definition

This convenience helper synchronously gets an auth token with #getAuthToken(Account, String, boolean, AccountManagerCallback, Handler).

[Android.Runtime.Register("blockingGetAuthToken", "(Landroid/accounts/Account;Ljava/lang/String;Z)Ljava/lang/String;", "GetBlockingGetAuthToken_Landroid_accounts_Account_Ljava_lang_String_ZHandler")]
[Android.Runtime.RequiresPermission("android.permission.USE_CREDENTIALS")]
public virtual string? BlockingGetAuthToken (Android.Accounts.Account? account, string? authTokenType, bool notifyAuthFailure);
[<Android.Runtime.Register("blockingGetAuthToken", "(Landroid/accounts/Account;Ljava/lang/String;Z)Ljava/lang/String;", "GetBlockingGetAuthToken_Landroid_accounts_Account_Ljava_lang_String_ZHandler")>]
[<Android.Runtime.RequiresPermission("android.permission.USE_CREDENTIALS")>]
abstract member BlockingGetAuthToken : Android.Accounts.Account * string * bool -> string
override this.BlockingGetAuthToken : Android.Accounts.Account * string * bool -> string

Parameters

account
Account

The account to fetch an auth token for

authTokenType
String

The auth token type, see #getAuthToken getAuthToken()

notifyAuthFailure
Boolean

If true, display a notification and return null if authentication fails; if false, prompt and wait for the user to re-enter correct credentials before returning

Returns

String

An auth token of the specified type for this account, or null if authentication fails or none can be fetched.

Attributes

Exceptions

if the authenticator failed to respond

if the request was canceled for any reason, including the user canceling a credential request

if the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble

Remarks

Java documentation for android.accounts.AccountManager.blockingGetAuthToken(android.accounts.Account, java.lang.String, boolean).

Portions of this page are modifications based on work created and shared by the Android Open Source Project and used according to terms described in the Creative Commons 2.5 Attribution License.

Applies to