I've been working on migrating an existing app into Firebase Authentication, and I need to import the user passwords into Firebase to avoid everybody having to go through a password reset. I setup a test user and imported him in, but after the import I'm finding that Firebase rejects the user's password.
I'm submitting this JSON File:
{"users": [{"localId": "5e722b92dd784e7fa37b98f94790a87e", "email": "[email protected]", "emailVerified": true, "passwordHash": "6ZoYxCjLONXyYIU2eJIuAw==", "displayName": "Test"}]}
I've tried adding "salt": "" to the above, but it had no effect.
I'm executing with this command:
firebase auth:import firebaseUsers.json --hash-algo=MD5 --rounds 0 --project projectname
Which runs successfully and does add the user. But the user just gets "The password provided is incorrect or the user does not have a password set" when I try to log in with them.
The value "rounds" is something that I took from examples online. I've also tried 1, 4, and 64, without success.
The password on this test account is abc123. I've confirmed that the base64 MD5 of abc123 is 6ZoYxCjLONXyYIU2eJIuAw== with this Python:
import hashlib
import codecs
import base64
m = hashlib.md5()
m.update("abc123".encode('utf-8'))
print (base64.b64encode(codecs.decode(m.hexdigest(), 'hex')).decode())
Which does indeed output 6ZoYxCjLONXyYIU2eJIuAw==
Can anybody hows gone through this process before see what I've done wrong here?