I have an application that handles authentication with the firebase-authentication service. Due to some recent changes in business logic, I need to start storing my users in a Mongo database as well. So, I must migrate the users to my Mongo database but in addition, I need them in Firebase to have the UID corresponding to the one generated by Mongo. Since I can’t change the firebase UID (if I’m wrong please correct me), my plan was something like this:
-Get all registered users in firebase
-Create these users with the additional information in mongo
-For each user created in Mongo, also create it in Firebase, using the Mongo ID as the UID.
-Delete old firebase users
However, my plan has a delicate detail. I understand that I cannot obtain firebase passwords, so when deleting and creating users, I would have to generate new passwords for all users. How can I address this situation to avoid this?