Fail to migrate user from my existing db
-
Hi FA team,
I am trying to migrate my users to FusionAuth, but fail to login after I migrate the users.
From my side,
Hashing algo should be : salted-hmac-sha256
From online hmac sha256 generator which is match with my db, so I believe it is in salted-hmac-sha256
the user i try to import:
email: test@email.com
password: 12345678 -> hashed: f3c43f0fb6cdf9f91e880b98db7476803f8bb033eb573c098fff5a51f0762e6d
salt: bBmcgRSathen i try to call and API /api/user/import with following request body
{ "users": [ { "email" : "test@email.com", "password" : "f3c43f0fb6cdf9f91e880b98db7476803f8bb033eb573c098fff5a51f0762e6d", "salt":"YkJtY2dSU2E=", "factor":1, "encryptionScheme" : "salted-hmac-sha256" } ] }
It return 200OK which is success
and then I call the API /api/login
{ "loginId":"test@email.com", "password":"12345678" }
it return 404 which means the loginId or password is not matched
Which step do I get wrong?
Thanks
-
I'm not sure what is wrong here, maybe try without setting 'factor' at all?
Anyway, if you have the user's password in plaintext then you can just use these as is and leave encryptionScheme and salt blank. According to docs regarding the password field:The User’s password. If encryptionScheme is provided this value is the existing password hash, if encryptionScheme is not provided this value is assumed to be plain text and it will be hashed during import.