Freigeben über


AccountManager.InvalidateAuthToken(String, String) Method

Definition

Removes an auth token from the AccountManager's cache.

[Android.Runtime.Register("invalidateAuthToken", "(Ljava/lang/String;Ljava/lang/String;)V", "GetInvalidateAuthToken_Ljava_lang_String_Ljava_lang_String_Handler")]
public virtual void InvalidateAuthToken (string? accountType, string? authToken);
[<Android.Runtime.Register("invalidateAuthToken", "(Ljava/lang/String;Ljava/lang/String;)V", "GetInvalidateAuthToken_Ljava_lang_String_Ljava_lang_String_Handler")>]
abstract member InvalidateAuthToken : string * string -> unit
override this.InvalidateAuthToken : string * string -> unit

Parameters

accountType
String

The account type of the auth token to invalidate, must not be null

authToken
String

The auth token to invalidate, may be null

Attributes

Remarks

Removes an auth token from the AccountManager's cache. Does nothing if the auth token is not currently in the cache. Applications must call this method when the auth token is found to have expired or otherwise become invalid for authenticating requests. The AccountManager does not validate or expire cached auth tokens otherwise.

It is safe to call this method from the main thread.

<b>NOTE:</b> If targeting your app to work on API level 22 and before, MANAGE_ACCOUNTS or USE_CREDENTIALS permission is needed for those platforms. See docs for this function in API level 22.

Java documentation for android.accounts.AccountManager.invalidateAuthToken(java.lang.String, java.lang.String).

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