# Delete stored credentials

> [!WARNING]
> **Deprecated:** Smart Lock for Passwords is deprecated. To ensure the continued security and usability of your app, [migrate to
> Credential Manager](https://developer.android.com/training/sign-in/passkeys/) today. Credential Manager supports passkey, password, and federated identity authentication (such as Sign-in with Google), stronger security, and a more consistent user experience.

Delete credentials from Smart Lock when either of the following circumstances
occur:

- Signing in with the credentials fails because the account no longer exists or the password is incorrect.
- The user completes the app's account deletion flow.

To delete credentials, call [`CredentialsClient.delete()`](https://developers.google.com/android/reference/com/google/android/gms/auth/api/credentials/CredentialsClient#delete(com.google.android.gms.auth.api.credentials.Credential)):

    mCredentialsClient.delete(credential).addOnCompleteListener(
            new OnCompleteListener<Void>() {
                @Override
                public void onComplete(@NonNull Task<Void> task) {
                    if (task.isSuccessful()) {
                        // Credential deletion succeeded.
                        // ...
                    }
                }
            });