Query for uid with email or name with flutter firebase

Allen Hu :

So my current flutter project has all users logged in with only google accounts. Is there a way to query for user UIDs with the user's gmail or google username?

Another followup question: I can't seem to find a clear documentation for firebase for flutter specifically, is there something like this out there?

Frank van Puffelen :

There is no way to query across the users in Firebase Authentication from the client-side SDKs, as that would be a security risk.

If you want to allow users to find other users, the two most common approaches are:

  1. Store information about each user in the database (typically either Realtime Database or Cloud Firestore), and search across that.
  2. Wrap the relevant parts of the Admin SDK in a Cloud Function, and call that from your app.

While the second may sound simpler/more common at first, using d database is actually by far more common with Firebase and allows more flexibility for relatively low complexity.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=33146&siteId=1