0

In documentation, It says that you can store basic profile information for every user in this page : https://firebase.google.com/docs/auth/android/manage-users#get_a_users_profile Well, I could get the authenticated user profile info as listed in docs but they didn't mention how to get another user's profile information given its user id. For example, if a user visits another user profile, I need to fetch that other user's name, photo.

  • 1
    There is no way get the profile of another user through the client-side SDK, as that would be a pretty bad security risk. You *can* get any user's profile with the Admin SDKs, which you'd run in a trusted environment, such as your developer machine, a server you control, or Cloud Functions. Alternatively, you can have every client write its profile information to a cloud database, such as Firebase's Realtime Database, or Cloud Firestore, and read it from there. – Frank van Puffelen Apr 16 '20 at 16:54
  • That's what I I would do, to store it in firestore database. So, What is the point of storing info with user authentication If I can't retrieve them for another user, especially that this info is not confidential, It's just a name and a photo. Even the documentation mentioned a way to update them, too. I think It's pretty confusing and weird. –  Apr 16 '20 at 17:16
  • 1
    While the user name and profile may not be confidential for your use-case, that doesn't apply to all situations or locale's where the Firebase API may be used. That's why, within the client-side APIs, a user can get and update their own profile, but they can't see or update another user's profile. If your app needs that, you can build that yourself with what I just told you. – Frank van Puffelen Apr 16 '20 at 17:29

0 Answers0