Delete stored credentials

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 CredentialsApi.delete():

Auth.CredentialsApi.delete(mCredentialsClient, credential).setResultCallback(
        new ResultCallback() {
            @Override
            public void onResult(Result result) {
                Status status = result.getStatus();
                if (status.isSuccess()) {
                    // Credential was deleted successfully
                }
            }
        });