handsome-agency-20541
12/06/2024, 1:07 PMbrief-egg-61061
12/06/2024, 1:07 PMbrief-egg-61061
12/06/2024, 1:08 PM/admin/recovery/code
endpoint with the user's identity ID. bash curl --request POST -sL \ --header "Authorization: Bearer ORY_API_KEY" \ --header "Content-Type: application/json" \ --request POST \ --data '{ "expires_in": "12h", "identity_id": "e01b5f2f-6afc-4194-8578-4cebcf69a4d5" }' https://$<http://PROJECT_SLUG.projects.oryapis.com/admin/recovery/code|PROJECT_SLUG.projects.oryapis.com/admin/recovery/code>
[Administrative account recovery](https://www.ory.sh/docs/kratos/manage-identities/account-recovery) 2. The API will respond with a recovery link and code: json { "recovery_link": "/ui/recovery?flow=79686c66-e427-4c1b-861e-083572f97964", "recovery_code": "76453943", "expires_at": "2022-10-25T03:09:37.60684766Z" }
3. Send the recovery link and code to the user: You'll need to implement a way to securely communicate this information to the user, typically via email or another secure channel. 4. User completes the recovery process: The user must access the recovery link and enter the recovery code in the form available at that link. After successfully recovering their account, they can create a new password. [Account Recovery Documentation](https://www.ory.sh/docs/kratos/self-service/flows/account-recovery-password-reset) It's important to note that this process doesn't directly reset the password from the admin side. Instead, it initiates a secure flow that allows the user to reset their own password. This approach maintains security by ensuring that even administrators don't have direct access to user passwords. Remember to use API Keys for authorization when making these admin API calls. You can learn more about API Keys in the Ory Network from the [Authorization with API Keys documentation](https://www.ory.sh/docs/concepts/personal-access-token).handsome-agency-20541
12/06/2024, 1:09 PMhandsome-agency-20541
12/06/2024, 1:09 PMbrief-egg-61061
12/06/2024, 1:09 PMbrief-egg-61061
12/06/2024, 1:10 PMhandsome-agency-20541
12/06/2024, 1:11 PM{
"error": {
"code": 400,
"status": "Bad Request",
"request": "59069cd6-c4b4-9113-acce-557c432cd81e",
"reason": "You cannot remove first factor credentials.",
"message": "The request was malformed or contained invalid parameters"
}
}
brief-egg-61061
12/06/2024, 1:11 PMbrief-egg-61061
12/06/2024, 1:11 PMhandsome-agency-20541
12/06/2024, 1:14 PMbrief-egg-61061
12/06/2024, 1:14 PMbrief-egg-61061
12/06/2024, 1:14 PM