Firebase import users from an existing application

How to import users of an existing application into firebase Simple Login using email / password.

I have keys and hashes and a custom collection with user data. Is it possible to just import it or do I need to use firebase user api.

+7
source share
2 answers

The best way to import existing user accounts from another service into Firebase for use in Firebase Simple Login is to call createUser(email, password, callback) for each combination of email addresses and password, provided that you have them. There is currently no ready-made way to import custom email addresses and password hashes into Firebase Simple Login, although ping support@firebase.com may be the way to do this.

If you already have an existing authentication mechanism that you would like to use, instead of using Firebase Simple Login, generate a custom token that allows you to continue to use existing authentication. This would require you to create a JTON Web Token (JWT) when each user is authenticated, and this token payload could then be used in your security rules, as described here: https://www.firebase.com/docs/security /security-rules.html .

+2
source

Now you can export / import users in Firebase v3.x. All you have to do is install the Firebase CLI (Firebase Tools), set up a folder on your computer that represents the mirror for the tools for the Firebase project. (as simple as firebase init in the corresponding folder)

Export: auth: export

To import: auth: import

Update: At the time I wrote this answer, the above example in the link above for auth:import contains 2 pieces: hash key and salt separator , which you can request from customer support. Perhaps in the future they will use tools or a console.

+1
source

All Articles