CredentialManager.ClearCredentialState Method

Definition

Clears the current user credential state from all credential providers.

[Android.Runtime.Register("clearCredentialState", "(Landroid/credentials/ClearCredentialStateRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)]
public void ClearCredentialState (Android.Credentials.ClearCredentialStateRequest request, Android.OS.CancellationSignal? cancellationSignal, Java.Util.Concurrent.IExecutor executor, Android.OS.IOutcomeReceiver callback);
[<Android.Runtime.Register("clearCredentialState", "(Landroid/credentials/ClearCredentialStateRequest;Landroid/os/CancellationSignal;Ljava/util/concurrent/Executor;Landroid/os/OutcomeReceiver;)V", "", ApiSince=34)>]
member this.ClearCredentialState : Android.Credentials.ClearCredentialStateRequest * Android.OS.CancellationSignal * Java.Util.Concurrent.IExecutor * Android.OS.IOutcomeReceiver -> unit

Parameters

request
ClearCredentialStateRequest

the request data

cancellationSignal
CancellationSignal

an optional signal that allows for cancelling this call

executor
IExecutor

the callback will take place on this Executor

callback
IOutcomeReceiver

the callback invoked when the request succeeds or fails

Attributes

Remarks

Clears the current user credential state from all credential providers.

You should invoked this api after your user signs out of your app to notify all credential providers that any stored credential session for the given app should be cleared.

A credential provider may have stored an active credential session and use it to limit sign-in options for future get-credential calls. For example, it may prioritize the active credential over any other available credential. When your user explicitly signs out of your app and in order to get the holistic sign-in options the next time, you should call this API to let the provider clear any stored credential session.

Java documentation for android.credentials.CredentialManager.clearCredentialState(android.credentials.ClearCredentialStateRequest, android.os.CancellationSignal, java.util.concurrent.Executor, android.os.OutcomeReceiver<java.lang.Void, android.credentials.ClearCredentialStateException>).

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