Hi guys, I am trying to set up blocking webhooks ...
# ory-network
p
Hi guys, I am trying to set up blocking webhooks for the after registration flow to call our server for some business logic during local development. However, I am currently facing a 504 gateway timeout error. I've opened my port for Ory to call my IP. If anyone has any ideas on how to resolve this issue, I would greatly appreciate your help.
Here is the part of the identity-config.yaml config concerning the webhook:
Copy code
registration:
      after:
        hooks: []
        oidc:
          hooks:
          - hook: session
        password:
          hooks:
          - config:
              body: <body>
              can_interrupt: true
              method: POST
              response:
                ignore: false
              url: http://<my ip>:<my port>/register
            hook: web_hook
        webauthn:
          hooks: []
r
Hi Nathan. The webhook URL must resolve to a publicly-routable address. In other words, 127.0.0.1, localhost, 192.168.x.y etc won’t work. You can use sites like https://webhook.site/ to debug webhooks, or use https://ngrok.com/ to forward them to your app running locally.
ory tunnel
is currently one-way only. Would be cool to have a webhook forwarder built-in at some point, though. Please let me know if you have more questions.
p
Hi Arne! Thank you for your answer! Yes I saw that it was not possible to put local IP when you want to update the identity-config.yaml file. But I'm more surprised that even when I open my internet box ports and use the public IP (https://www.whatismyip.com/) it still doesn't work. Is this a normal behavior?
r
It’s difficult to debug such an issue from afar. Many things can go wrong with port-forwarding in this manner. For example many ISPs don’t give publicly routable IPv4 addresses to end customers anymore. Something like ngrok or webhook.site should be much more reliable.
p
Ok thank you Arne! So if I summarize, for local development (on a dev pc), we can't use web hooks. So if we really need to have these web hooks, for business logic reasons, there is no way to have exactly the same environment between production and development with Ory Cloud? I need to start an Ory Kratos locally for example?
r
You absolutely can test webhooks locally 👍 For example, ngrok.io is meant for exactly this use case.
p
Ok will test that asap! Thank you so much!
142 Views