I need to get a specific user data in firebase auth using javascript by a UID (User id). If it's not allowed to get a user by id, at least is there a way to get all users, then i could loop through these users and check if the id of the user equals to that id. Is that possible?
Asked
Active
Viewed 259 times
0
-
It's not possible with web and mobile client SDKs. That's a security problem. You can only do it on your backend with the Firebase Admin SDK. – Doug Stevenson Aug 25 '21 at 15:35
1 Answers
0
Add another collection
named users
where you store your desired data in and keep the documents id's in sync with the auth uids.

PRSHL
- 1,359
- 1
- 11
- 30
-
I tried that but, for example if i change the displayName of a user in Authentication that will not be changed in Firebase Firestore Collection. How do i handle THAT? – Ali Guliyev Aug 25 '21 at 15:16
-
i am starting to understand there is no other way of doing that. But why would google not supply a solution? its probably a security thing?.. they also made in really confusing with the ADMIN SDK etc. that also means we need a solution for deleting a user ( by admin for example) etc etc... – Sagive Aug 06 '22 at 14:03