alert-painter-66256
09/01/2024, 4:39 PMchilly-king-10285
09/01/2024, 4:40 PMchilly-king-10285
09/01/2024, 4:40 PMalert-painter-66256
09/01/2024, 4:40 PMchilly-king-10285
09/01/2024, 4:40 PMchilly-king-10285
09/01/2024, 4:41 PMweb_hook
action to trigger any custom, external logic. This could potentially be used to check an external database if a username is already taken before you can register a new account. However, the specific implementation details would depend on your application and the database you are using. Here's a general idea of how you might set up the web_hook
action: json { "hook": "web_hook", "config": { "url": "<https://your-database-check-endpoint>", "method": "POST", "body": "base64://{JSONNET_FROM_CLIPBOARD}" } }
In this configuration, url
would be the endpoint in your application that checks the database for the username. The body
would contain the data you want to send to this endpoint, encoded in Base64. This data would be written in Jsonnet, a data templating language for app configuration. Please note that this is a general guide and the exact details would depend on your specific use case and the database you are using. You can find more information about using webhooks in Ory in the [Ory documentation](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks).alert-painter-66256
09/01/2024, 4:50 PMchilly-king-10285
09/01/2024, 4:50 PMchilly-king-10285
09/01/2024, 4:51 PMparse
field to true
in the webhook configuration. Here's an example: yaml hook: web_hook config: response: parse: true
The external service called in the flow decides if it allows the flow to continue, or if it interrupts the flow. For example: - For HTTP response codes 1xx
, 2xx
, and 3xx
, the flow is not interrupted. - For HTTP response codes 4xx
, 5xx
, the external service interrupts the flow and returns a predefined payload. You can define the specific point in the flow where this webhook is called: - When the webhook parses the response, the logic is called before the system creates a new identity. - When the webhook does not parse the response, the logic is called after the system creates a new identity. You can call a webhook before and after the system creates an identity. To do that, define two webhooks with different parse
values: yaml - hook: web_hook config: response: parse: true - hook: web_hook config: response: parse: false
Flow-interrupting webhooks work best if you give users meaningful information about the status of their flow. The best place to trigger these hooks is after
flows. For more information, please refer to the [Ory documentation](https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#flow-interrupting-webhooks).alert-painter-66256
09/01/2024, 9:23 PMchilly-king-10285
09/01/2024, 9:23 PMchilly-king-10285
09/01/2024, 9:23 PM400 Bad Request
error, which should interrupt the flow if parse: true
is set. However, it's not preventing the user from signing up as expected. Unfortunately, the knowledge sources provided do not contain specific information about troubleshooting this issue. It might be helpful to double-check the configuration of your webhook and the endpoint it's calling. Make sure that the endpoint is set up correctly to handle the request and return the appropriate response. If you're still having trouble, I would recommend reaching out to the Ory community or checking the [Ory documentation](https://www.ory.sh/docs/) for more detailed information and guidance.