Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

delete firebase authenticated user from web application

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.

like image 486
Michael Gabbay Avatar asked Nov 24 '25 07:11

Michael Gabbay


1 Answers

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.

like image 122
Frank van Puffelen Avatar answered Nov 27 '25 00:11

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!