0

I currently only know how to read data from Firestore Database page. The authentication page in FireBase contains the list of all registered users and I want to access it in my code, so I have a list of all registered users.

How can I do that?

Regards

Frank van Puffelen
  • 565,676
  • 79
  • 828
  • 807
omer929292
  • 29
  • 1
  • 4

1 Answers1

1

There is no way to access the list of users in a project from any of the client-side SDKs of Firebase, as that would be a security risk.

If you want to show information about other users in the app, the two most common approaches are:

  • Store the information about each user in the database, when they sign in, and then read it from there. This way you can secure access to the user data with the server-side security rules of your database.
  • Use one of the Admin SDKs of Firebase, which do have methods to list users, to access the data, and wrap that in a custom API endpoint (for example through Cloud Functions or Cloud Run) so that your app can call it. In this case you can write server-side code to secure access to the data.

This has been covered quite a few times before, so I recommend also checking out:

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