I need to import a list of users with email and password into Firebase.
I am trying to import users into Firebase using the auth: import CLI command. ( https://firebase.google.com/docs/cli/auth-import )
I chose hash-algo HMAC_MD5 ,
I use helpmeplease as a secret line for encritption -> in Base64 becames aGVscG1lcGxlYXNl
I use mypass as a test password: crypted with HMAC_MD5 and secret "helpmeplease" IT becames 3a52377f6635d298436013953a1ce4dd and becames Bas64 M2E1MjM3N2Y2NjM1ZDI5ODQzNjAxMzk1M2ExY2U0ZGQ =
I am using user.json
{ "users": [
{
"localId": "9997",
"email": "test@test.com",
"passwordHash": "M2E1MjM3N2Y2NjM1ZDI5ODQzNjAxMzk1M2ExY2U0ZGQ=",
"displayName": "9997",
}
] }
I use the command:
**firebase auth:import --hash-algo='HMAC_MD5' --hash-key='aGVscG1lcGxlYXNl' --project='my-project-name-test' users.json**
and the result:
Processing users.json (194 bytes)
Start import of 1 account.
✔ Imported successfully .
and the user is imported into the user database.
BUT .. when I try to login using
auth (). signInWithEmailAndPassword (' test@test.com ', 'mypass') . I get this error:
{[Error: the password is incorrect or the user does not have a password.] Code: 'auth / wrong-password',
: ' .' }
, ... ?