<@U04UQ68083H> is that possible to store password ...
# ory-copilot
r
@chilly-king-10285 is that possible to store password on hash format in user tratis or admin identites. and we bypass the actual ory password
b
A message from kapa.ai
Based on the knowledge sources provided, it is not recommended to store hashed passwords in user traits or admin identities and bypass Ory's password handling. Ory provides specific methods for importing and managing hashed passwords securely. Here's the correct approach: 1. Ory supports importing hashed passwords using the [PHC format](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities#hashed-passwords). This allows you to import existing hashed passwords from various algorithms. 2. When creating or updating an identity, you can provide the hashed password in the
credentials.password.config.hashed_password
field of the request body. This is the proper way to import hashed passwords into Ory. 3. If your current hashing algorithm is not supported or you can't access the hashed passwords, Ory offers a "graceful" migration option using a password migration hook. This is configured by setting
use_password_migration_hook
to
true
in the identity creation or update payload. Here's an example of how to properly import a hashed password when creating an identity:
Copy code
json {   "schema_id": "<preset://email>",   "traits": {     "email": "<mailto:user@example.com|user@example.com>"   },   "credentials": {     "password": {       "config": {         "hashed_password": "$2a$10$ZsCsoVQ3xfBG/K2z2XpBf.tm90GZmtOqtqWcB5.pYd5Eq8y7RlDyq"       }     }   } }
It's important to use Ory's built-in methods for password management to ensure security and proper integration with Ory's authentication system. Storing passwords (even hashed) in user traits or admin identities would bypass Ory's security measures and is not recommended. For more detailed information on importing identities and credentials, you can refer to the [Import identities documentation](https://www.ory.sh/docs/kratos/manage-identities/import-user-accounts-identities).