straight-dawn-40806
07/16/2025, 8:38 AMbrief-egg-61061
07/16/2025, 8:38 AMbrief-egg-61061
07/16/2025, 8:39 AMhashed_password
field of the identity creation payload. Here’s how you can do it: ### Example cURL Command Replace the placeholders with your actual values: bash curl --request POST \ --header "Authorization: Bearer <ORY_ACCESS_TOKEN>" \ --header "Content-Type: application/json" \ --data '{ "schema_id": "<preset://email>", "traits": { "email": "<mailto:user@example.org|user@example.org>" }, "credentials": { "password": { "config": { "hashed_password": "$argon2id$v=19$m=32,t=2,p=4$cm94YnRVOW5jZzFzcVE4bQ$MNzk5BtR2vUhrp6qQEjRNw" } } } }' \ https://<YOUR_PROJECT_SLUG>.<http://projects.oryapis.com/admin/identities|projects.oryapis.com/admin/identities>
The value for hashed_password
should be the Argon2 hash string you have from your provider. The format is: $argon2id$v=<version>$m=<memory>,t=<iterations>,p=<parallelism>$<hash>
[Importing Argon2 hashed passwords](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords) ### Kratos Configuration YAML To ensure that Ory Kratos can accept and migrate Argon2 hashes, you should configure the password hasher in your config.yml
. By default, Kratos uses BCrypt, but you can set it to Argon2id if you want new passwords to be hashed with Argon2id: yaml hashers: algorithm: argon2 argon2: parallelism: 1 memory: 128MB iterations: 3 salt_length: 16 key_length: 32
[Kratos password hashing configuration](https://www.ory.sh/docs/self-hosted/kratos/configuration/password) Note: - Ory Kratos can compare stored Argon2 hashes and, if your configured hasher is different (e.g., BCrypt), it will migrate the password to the new algorithm on the next successful login. - You do not need to set the hasher to Argon2id to import Argon2 hashes, but doing so will keep the hashing algorithm consistent for new passwords. --- If you need to import multiple users, use the [Identity Import API](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#bulk-import-identities-from-other-providers) with a similar payload structure for each user.