narrow-hospital-35452
11/10/2024, 12:55 PMbrief-egg-61061
11/10/2024, 12:55 PMbrief-egg-61061
11/10/2024, 12:55 PM/self-service/recovery/flows
with a flow ID parameter [Ory API Reference](https://www.ory.sh/docs/reference/api). Here's an example of how to call this endpoint using cURL: bash curl -H 'Content-Type: application/json' \ -H 'Accept: application/json' \ -c cookies.txt \ -b cookies.txt \ "https://$<http://PROJECT_SLUG.projects.oryapis.com/self-service/recovery/flows?id=<your-flow-id|PROJECT_SLUG.projects.oryapis.com/self-service/recovery/flows?id=<your-flow-id>>"
[Ory Docs: Get Recovery Flow](https://www.ory.sh/docs/kratos/bring-your-own-ui/custom-ui-basic-integration#get-recovery-flow) If you need to perform custom actions when this endpoint is called, you might want to look into Ory's extension capabilities or consider implementing middleware in your application to intercept and process these requests. However, the provided documents don't mention a built-in webhook feature for this specific scenario.narrow-hospital-35452
11/10/2024, 12:57 PMbrief-egg-61061
11/10/2024, 12:57 PMbrief-egg-61061
11/10/2024, 12:57 PMbash ory get identity-config --project <project-id> --workspace <workspace-id> --format yaml > identity-config.yaml
2. Then, add the webhook configuration to the downloaded file. You would add something like this to your `identity-config.yaml`: yaml selfservice: flows: recovery: after: hooks: - hook: web_hook config: url: <http://your-webhook-url.com> method: POST
3. Finally, update the Ory Identities configuration using the modified file: bash ory update identity-config --project <project-id> --workspace <workspace-id> --file identity-config.yaml
[Ory Docs: Configure Hooks](https://www.ory.sh/docs/kratos/hooks/configure-hooks#trigger-precedence) The web_hook
action type is available for all flows except error and logout, and it allows you to trigger external and custom logic [Ory Docs: Available Actions](https://www.ory.sh/docs/kratos/hooks/configure-hooks#available-actions). Remember, you can configure hooks to run before or after the recovery flow, depending on your needs. The after
hooks are executed when the user submits or completes the flow [Ory Docs: Trigger Precedence](https://www.ory.sh/docs/kratos/hooks/configure-hooks#trigger-precedence). I hope this clarifies how you can trigger a webhook on the recovery flow in Ory Kratos. Let me know if you need any further information!narrow-hospital-35452
11/10/2024, 12:57 PMafter
, what option do ory kratos have?brief-egg-61061
11/10/2024, 12:58 PMbrief-egg-61061
11/10/2024, 12:58 PMafter
for configuring hooks in various flows, including the recovery flow. This option is called before
. The before
option allows you to trigger hooks when a user starts a flow, as opposed to the after
option which triggers hooks when a user submits or completes a flow. Here's a brief explanation of these options: 1. `before`: Hooks configured with this option are executed when the user starts a flow. 2. `after`: Hooks configured with this option are executed when the user submits or completes the flow. This information is clearly stated in the [Ory Docs: Trigger Precedence](https://www.ory.sh/docs/kratos/hooks/configure-hooks#trigger-precedence): "Ory executes the before
actions when the user starts a flow. Ory executes the after
actions when the user submits or completes the flow." To illustrate this, here's an example of how you might configure both before
and after
hooks for a login flow: yaml selfservice: flows: login: before: hooks: - hook: hook_1 after: hooks: - hook: hook_2
In this configuration, hook_1
would be executed when the user starts the login flow, while hook_2
would be executed when the user successfully completes the login process. It's worth noting that these options are available for various flows in Ory Kratos, including login, registration, recovery, settings, and verification flows [Ory Docs: Action Triggers](https://www.ory.sh/docs/kratos/hooks/configure-hooks#action-triggers).narrow-hospital-35452
11/10/2024, 1:29 PMv0.11.1
to v1.3.1
brief-egg-61061
11/10/2024, 1:29 PMbrief-egg-61061
11/10/2024, 1:29 PM