Firebase authentication - Database

Does anyone know why this happen?
My sign up page is connected to firebase authentication and I created a Database for User’s storage but when the authentication is created the UID is different than the UID’s from database even if it’s the same credentials

It is normal for the Firebase authentication UID (unique identifier) to be different from the UID in the database, even if they are the same credentials. This is because the authentication UID is a unique identifier assigned by Firebase to the user when they authenticate, while the database UID is a unique identifier assigned by you to the user when you add them to the database.

If you want to link the authentication and the database for a particular user, you can do so by using the authentication UID as a key in the database. For example, if you want to add additional information for the user with authentication UID “abc123” in your database, you can create a node in your database called “users” and add a child with key “abc123” to store the additional user information.

I hope this helps you understand why the authentication UID and the database UID are different and how you can link a user’s information between them.

1 Like