Hi! I wonder how I should configure webhooks if I...
# ory-network
f
Hi! I wonder how I should configure webhooks if I’d like to prevent certain emails to be changed. I have added an
after
webhook on
settings
looking like this:
Copy code
can_interrupt: false
              method: POST
              response:
                ignore: false
                parse: false
In this scenario I do receive the webhook. It does not seem to care if I return Unauthorized/forbidden, the change of email still goes through. I thought that changing it to
parse: true
would do it like this:
Copy code
can_interrupt: false
              method: POST
              response:
                ignore: false
                parse: true
When I do that however I stop receiving the webhook calls.
s
I think you want
can_interupt: true
and
parse: true
because it would interrupt the flow right?
f
Ye, I tried that as well and I don’t get the webhook at all
I didn’t find anything about
can_interrupt
in the docs though.
As soon as I set
can_interrupt
to
true
or
parse
to
true
I stop receiving the webhooks
When I have them all 3 to False I get the webhook.
Perhaps it is something you can see in the logs @steep-lamp-91158?
s
sorry, I can help now
f
Hey @steep-lamp-91158, Are you working today to assist the debugging further?
s
I'm out today, maybe @bland-eye-99092 can help?
@fast-lunch-54279 should be able to forward this to someone
f
@refined-kangaroo-48640 can you take a look please
r
The
can_interrupt
field is deprecated and should not be used.
response.ignore=false
&&
response.parse=true
should be what you need, I think
f
Thanks! I’ve tried the alternative of not touching the
can_interrupt
field (it is a field I got from pulling the config using the Ory CLI). When I go from
Copy code
ignore: false
                parse: false
to
Copy code
ignore: false
                parse: true
I stop receiving the webhook calls all together.
Might be that our WAF rules for some reason block the request.. will dig a bit.
r
alrighty
I debugged this
try to move the
web_hook
yaml block inside the
profile
block (which is in turn inside the
after
block)
f
It is pretty weird though that it would work without the parse and then when I enable parse it stops working.
r
Copy code
settings:
      after:
       profile:
          hooks:
          - hook: web_hook
            config:
              url: <https://webhook.site/6c0a7750-d3fa-4779-b860-3e9626988e10?after&can_interrupt=true&ignore=false&parse=false&profile>
              method: POST
              body: <base64://ZnVuY3Rpb24oY3R4KSB7CgljdHg6IGN0eCwKfQo>=
              can_interrupt: true
              response:
                ignore: false
                parse: false
We’re tracking improvements to the webhook configuration in this ticket: https://github.com/ory/kratos/issues/3352 @fast-lunch-54279 we may want to prioritize that ticket.
f
Looks like I am now receiving it!
Thanks a lot @refined-kangaroo-48640! It is now working as expected. Is there anything in the docs I missed around
hooks
,
password
,
profile
and when to use what?
r
Glad I could help. The webhook configuration needs a major overhaul, sorry for the confusion. For the moment, I’d recommend you don’t use the top-level hook configuration at all, but only the nested config inside the
password
,
profile
,
oidc
etc blocks.
🙏 1