Firebase users and information - firebase

How do I store profile information for users in App Inventor using Firebase (e.g:Full name, age, some answers to some question that need to be displayed on his profile)?
I tried the Auth extension, but it doesn't provide too many options. Do I make use of user's UID?

Using their user ID, save their data in Cloud Firestore or Realtime Database. Then you can retrieve and store any data you want.

Related

Read Firebase authentication records with R

Using R, I am trying to read the Firebase authentication records created by users for our project, projectID. To be clear, I do not wish to read, nor can I read, the user pswd, just the Firebase authentication ID, known as the User UID.
Firebase creates a unique UID when a user record is created. This in turn populates a collection, call it collectionID, where the key to collectionID is the Firebase authentication User UID. Other information about the user's use of our application is stored within this collection.
I can read the collectionID using the Firestore library created by Luis Rodriguez - github("luizmirodriguez/FireStore") - as follows:
fireStore.download(projectID,collectionID,auth$credentials$access_token).
I cannot download the authentication records shown in Firebase Console with R today. Does anyone know how to do this?
It may be as simple as knowing the name of the collection (authentication, authentication/users, authentication/users_uid all produce errors).
Any help appreciated

Is it possible for Firestore to generate the same uid when registering a user?

I have my backend hosted in firebase. Whenever a new user registers I create a new account in my firestore collection. Each user will be identified by a unique uid generated by firebase. Is it possible with enough users to generate the same uid and hence write over another user's data when registering? Or does firestore have any built-in measures to prevent this from happening? Thanks in advance.
Firebase Auth guarantees that each user will have a truly unique ID within your project. There is nothing you have to do. Just accept the UID it generates.

Retrieve FirebaseUser data by UID using only FirebaseAuth

I am using theFirebaseAuth Flutter plugin in order to manage the authentication process of users in my app. So far, I have been able to retrieve data from the current user with no trouble. However, I would like to retrieve user information data such as the profile picture using the UID of that user. This is quite easy when the user I want to get the data from is the current user, but I can't see the way of doing that when the user is different.
Is it possible, in some way, to build an instance of FirebaseUser specifying the UID? Or am I forced to store that information in some external storage platform? I prefer
For security reasons, getting user info from any user besides the current one has to be done in a managed environment like a server or Cloud Functions. You can use the Admin SDK to handle this.

does signInAnonymously add a record to your Users collection?

I just ran a test of Auth.auth().signInAnonymously and printed the uid of the anonymously created User. I then looked up that ID in my Users collection and didn't find a record. Is that User document only created when you convert them to non-anonymous?
Thanks.
Is that User document only created when you convert them to non-anonymous?
No, the user will appear in the database only when you'll add it. Firebase authentication does not write any data to your Cloud Firestore database.

Storing Firebase UID in an external database

I am using firebase auth for a project. Since we don't want to be in charge of handling passwords, and eventually want to add social login we're going to use FireBase.
We have an .NET WEB API set up right now with its own database. In this database some tables have reference to user's. Example: Order table would need a customer id.
Since we're only using Firebase Auth we're thinking about storing some user data in our database. Specifically:
FirstName | LastName | Role.
Would it be okay to store the Firebase UID in our tables as well, or is the a different parameter we should be using?
Yes, what you want is a unique identifier for each user and sounds like Firebase's auth UID is unique across the same project. Based on Firebase's document:
getUid() Returns a string used to uniquely identify your user in
your Firebase project's user database.
Also check this answer:
Is Firebase UID unique across multiple apps?
Yes, it's very common to store Firebase Auth UIDs in a database to store per-user information.

Resources