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?