Android.Accounts.AccountManager.BlockingGetAuthToken Method
This convenience helper synchronously gets an auth token with AccountManager.getAuthToken(android.accounts.Account, java.lang.String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler).

Syntax

[Android.Runtime.Register("blockingGetAuthToken", "(Landroid/accounts/Account;Ljava/lang/String;Z)Ljava/lang/String;", "GetBlockingGetAuthToken_Landroid_accounts_Account_Ljava_lang_String_ZHandler")]
public virtual string BlockingGetAuthToken (Account account, string authTokenType, bool notifyAuthFailure)

Parameters

account
The account to fetch an auth token for
authTokenType
The auth token type, see AccountManager.getAuthToken(android.accounts.Account, java.lang.String, android.os.Bundle, android.app.Activity, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler)
notifyAuthFailure
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

Documentation for this section has not yet been entered.

Exceptions

TypeReason
Android.Accounts.AuthenticatorExceptionif the authenticator failed to respond
Android.Accounts.OperationCanceledExceptionif the request was canceled for any reason, including the user canceling a credential request
Java.IO.IOExceptionif the authenticator experienced an I/O problem creating a new auth token, usually because of network trouble

Remarks

This convenience helper synchronously gets an auth token with AccountManager.getAuthToken(android.accounts.Account, java.lang.String, boolean, android.accounts.AccountManagerCallback<android.os.Bundle>, android.os.Handler).

This method may block while a network request completes, and must never be made from the main thread.

This method requires the caller to hold the permission NoType:android/Manifest$permission;Href=../../../reference/android/Manifest.permission.html#USE_CREDENTIALS.

[Android Documentation]

Requirements

Namespace: Android.Accounts
Assembly: Mono.Android (in Mono.Android.dll)
Assembly Versions: 0.0.0.0
Since: Added in API level 5