3

I want to add the option to remove A user from firebase authenticated Users list - from my web application. The authentication method I used is email and password authentication.

the application is mobile single page application, based on js/html/css files (browser application).

  1. can I use firebase Admin SDK to delete A user?
  2. is there A better way of doing it? what is the best practice?

Thanks Michael.

Michael Gabbay
  • 413
  • 1
  • 4
  • 20

1 Answers1

3

The Firebase Admin SDK can be used to delete a user.

But it should only be used in trusted environments, since it allows full access to most of the Firebase services in your project. Typical trusted environments are: a server you control, or Cloud Functions for Firebase.

So a common way to do this is to build a Cloud Function that deletes the user (using the Admin SDK) and then call that function from your web app. You will have to ensure that only trusted users can call the functionality then, typically by checking their UID or email address against a known list of trusted users.

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807