<@U04UQ68083H> Is it possible to fetch the user pa...
# ory-copilot
c
@chilly-king-10285 Is it possible to fetch the user password on registration/password change (hashed or not) in kratos
c
A message from kapa.ai
Yes, it is possible to fetch the user password during registration or password change in Ory Kratos. However, the password is typically hashed for security reasons. During the registration process, the password is part of the
methods
payload in the Registration Flow. Here is an example of how to fetch it:
Copy code
bash curl -H "Accept: application/json" -s \     '<https://playground.projects.oryapis.com/self-service/registration/flows?id=388ae8da-4c44-4765-bfa8-669963d388f5>' | jq
In the response, you will find the password field in the
nodes
array:
Copy code
json {   "type": "input",   "group": "password",   "attributes": {     "name": "password",     "type": "password",     "required": true,     "disabled": false   },   "messages": null,   "meta": {     "label": {       "id": 1070001,       "text": "Password",       "type": "info"     }   } }
Similarly, during password update, the password is part of the
methods
payload in the Settings Flow:
Copy code
bash curl -s -X GET \     -H "Authorization: Bearer $sessionToken" \     -H "Accept: application/json" \     <https://playground.projects.oryapis.com/self-service/settings/api> | jq -r '.ui.nodes[] | select(.group=="password")'
In the response, you will find the password field in the
nodes
array:
Copy code
json {   "type": "input",   "group": "password",   "attributes": {     "name": "password",     "type": "password",     "required": true,     "disabled": false   },   "messages": [],   "meta": {     "label": {       "id": 1070001,       "text": "Password",       "type": "info"     }   } }
Please note that these examples fetch the password field, not the actual password entered by the user. The actual password is not returned in the response for security reasons. For more information, you can refer to the [Ory Kratos User Registration Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-registration) and [Ory Kratos User Settings and Profile Updates Documentation](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#update-password). Sources: - [User Registration](https://www.ory.sh/docs/kratos/self-service/flows/user-registration#registration-with-usernameemail-and-password-1) - [User Settings and Profile Updates](https://www.ory.sh/docs/kratos/self-service/flows/user-settings#update-password-1)