billions-elephant-38030
06/03/2024, 3:35 PMchilly-king-10285
06/03/2024, 3:35 PMbillions-elephant-38030
06/03/2024, 3:35 PMchilly-king-10285
06/03/2024, 3:35 PMchilly-king-10285
06/03/2024, 3:35 PM204
or 200
HTTP status code without a response body. Here is an example of how you can handle the webhook: python def handle_webhook(request): # Use the request payload to decide how Ory should proceed # If you want to accept the token exchange without modification return 204 # or 200
However, if you want to modify the claims of the issued tokens and instruct Hydra to proceed with the token exchange, you need to return 200
with a JSON response body. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/hydra/guides/claims-at-refresh#responding-to-the-webhook).chilly-king-10285
06/03/2024, 3:35 PMbillions-elephant-38030
06/03/2024, 3:36 PMchilly-king-10285
06/03/2024, 3:36 PMchilly-king-10285
06/03/2024, 3:36 PMbody
field in the webhook configuration. If you want to send an empty payload, you can simply not define the body
field or set it as an empty string. Here is an example of a webhook configuration with an empty payload: yaml hook: web_hook config: url: <https://your-webhook-url.com> method: POST body: ""
For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#configuration-overview).billions-elephant-38030
06/03/2024, 3:37 PMchilly-king-10285
06/03/2024, 3:37 PMchilly-king-10285
06/03/2024, 3:37 PMplaintext
and html
fields are mandatory when defining the body
key. If the system can't use the custom templates, it falls back to the built-in templates or to the template_override_path
(if specified). Here is an example of how you can define the body
key: yaml courier: template_override_path: /conf/courier-template templates: verification: valid: email: body: html: <https://some-remote-resource/gotmpl> plaintext: <base64://SGV5IHlvdSBkZWNvZGVkIG1lIDop> subject: <file://some-file/subject.gotmpl>
If you are not providing these fields, you might encounter the error you mentioned. For more details, you can refer to the [Ory documentation](https://www.ory.sh/docs/kratos/self-hosted/mail-courier-templates#configuration).billions-elephant-38030
06/03/2024, 3:38 PMchilly-king-10285
06/03/2024, 3:38 PMchilly-king-10285
06/03/2024, 3:38 PM