Hello 'm trying to export my users from django to ...
# ory-selfhosting
f
Hello 'm trying to export my users from django to kratos. hash algo is pbkdf2 https://docs.djangoproject.com/en/dev/topics/auth/passwords/#pbkdf2-and-bcrypt this is doc of Kratos https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords this how i try to get hashed pass hasher = identify_hasher(user.password) password_data = hasher.decode(user.password) "password": { "config": { "hashed_password": f"$pbkdf2-sha256$i={password_data['iterations']},l=64${password_data['salt']}${password_data['hash']}" } } this result $pbkdf2-sha256$i=260000,l=64$izvFshjOXirWGqMWCG8fY4$eRft8tfitqNJbXMLFQy3tg5O0vLnbzDB9KvJ8zl41m4= but in kratos I can not use my password. it sais The provided credentials are invalid, check for spelling mistakes ..
👀 1
✅ 1
v
Try to remove the padding character (
=
) at the end of
$pbkdf2-sha256$i=260000,l=64$izvFshjOXirWGqMWCG8fY4$eRft8tfitqNJbXMLFQy3tg5O0vLnbzDB9KvJ8zl41m4=
. Kratos uses base64 encoding without padding (RawStdEncoding) when decoding the salt and the hash.
🙌 1
f
Hooray, it works now. Thanks a lot!! Beside, password_data['salt'] was not encoded to base64. 1. Removed padding from the hash 2. encoded salt.