1

I implement Google Sign-in method to my App I can see the user that login by this method under Authentication provider and it get accesses.

Now I try to remove the User from the google Auth list by using the Code line: FirebaseAuth.getInstance().signOut();

It go back to my Login activity but the next time I push the login Button he login and not asking to choice a account to login.

I delete the user from Firebase and the User still get access

How can I remove completely the User from the list Auth and the user need to choice and logging aging?

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
  • This [resource](https://medium.com/firebase-tips-tricks/how-to-create-a-clean-firebase-authentication-using-mvvm-37f9b8eb7336) will also help. – Alex Mamo Jun 23 '22 at 10:52

1 Answers1

0

Signing out of the account is different from deleting the account. The following code will just sign out the account :

FirebaseAuth.getInstance().signOut();

To delete the account use the following :

FirebaseAuth.getInstance().deleteUser(uid);

For deleting multiple users at once, do the following :

DeleteUsersResult result = FirebaseAuth.getInstance().deleteUsersAsync(
Arrays.asList("uid1", "uid2", "uid3")).get();
System.out.println("Successfully deleted " + result.getSuccessCount() + " users");
System.out.println("Failed to delete " + result.getFailureCount() + " users");
for (ErrorInfo error : result.getErrors()) {
  System.out.println("error #" + error.getIndex() + ", reason: " + error.getReason());
}
Karunesh Palekar
  • 2,190
  • 1
  • 9
  • 18