Firebase Authentiation: should I create my own user_id(uuid) and map with firebase(UID)?
Posted by NewKidInOldTown@reddit | ExperiencedDevs | View on Reddit | 3 comments
I'm building a web application where users can sign up and log in using their email or through third-party providers like Google and Facebook. I'm using Firebase for authentication and want to ensure a secure and efficient process for handling user authentication and authorization.
This is what i have figured it out auth flow using firebase
Client gets id token from current user after logging in
Each request headers put this authentication barear token.
Server: extract authentication barear token, use Firebase admin sdk use verifyIdToken methods decode user information like uid, email etc, handle proper error like Id token invalid or expired,
Should I create a table on my backend server and map firebase uid with my own user_id(uuid)? and use my own generated uuid for foreign key to another table?
aisha_46@reddit
For user authentication, you can try using a simple SMS based authentication. There are multiple third party APIs available for the same. You can try Message Central.
BeenThere11@reddit
Yes always better to have an internal ID. If its multi tenant , then you need tenant and uid . Better to know which tenant it belongs to for authentication by tenant also
NewKidInOldTown@reddit (OP)
Thx boss.