I have some issues receiving webhooks as part of t...
# ory-network
f
I have some issues receiving webhooks as part of the recovery flow, I did this through the UI and it now looks like this:
Copy code
recovery:
      after:
        default_browser_return_url: <MY APP URL>
        hooks:
        - config:
            auth:
              config:
                password: <PASSWORD>
                user: <USER>
              type: basic_auth
            body: <https://storage.googleapis.com/><MY BUCKET>
            can_interrupt: false
            method: POST
            response:
              ignore: false
              parse: true
            url: <MY URL>
          hook: web_hook
      before:
        hooks: []
      enabled: true
      lifespan: 24h0m0s
      notify_unknown_recipients: false
      ui_url: <MY ui url>
      use: code
We are receiving other webhooks but this one is not reaching us it seems. Neither is the user blocked because we get a call for sending the email related to this almost immediately after.
The use case we have is that we’d like to block reset-password in specific scenarios and hence we want this webhook to be able to block that.
s
what is the project ID?
f
e45f404d-f3cf-48d3-b250-79ad0816db7f
s
Can you trigger it again, as I cannot find any occurrence of it? I am not able to
And ideally send me the time when you did the recovery
f
I did one just now
In addition to ^ we’ve setup https://www.ory.sh/docs/kratos/self-hosted/email-http for this and that call I do get.
s
hm doesn't look like it is an issue with your jsonnet or something, but instead it is never triggered 🤔
f
Yes, that is my guess as well. Seems more like a bug on the triggering than anything else?
s
did you only request a code via email, or did you actually submit it and get a valid session?
because that webhook is only firing AFTER the full recovery flow, so basically after the code has been verified
f
aah, that is not what I expected.
Now I get the call when I fill in the recovery code. Thank you.
s
😂 sorry for the confusion
I see how you might want a hook in between, but I think that is currently not available
f
I understand, then I guess that will be my best alternative for now!
Thanks for the help.
@steep-lamp-91158 What would you suggest to return when we want to block a reset password? What we have right now is this but doesn’t seem to communicate the message to the user
Copy code
content={
    "messages": [
        {
            "instance_ptr": "#/credentials",
            "messages": [
                {
                    "id": 101,
                    # Unique numeric ID of the error that helps the frontend to interpret this message.
                    "text": "Unable to reset password for user with only SSO login registered",
                    "type": "validation",
                    "context": {"value": "not supported"},
                },
            ],
        },
    ],
},
status_code=HTTPStatus.FORBIDDEN,
s
So it is blocked but the message does not show up on the UI?
f
Ye, but we have a custom UI though so it might be on our frontend.
Didn’t see the message in the response though from the call the frontend does.
s
I think you need to use the same
instance_ptr
as the UI does for rendering, so check what the password field has as a name/id.
f
It is the
recover
field in this case
s
#/credentials
looks wrong to me
f
It is an after hook on where the users adds the recovery code
Will check, thanks.
Where can I find documentation for alternatives? I can only find examples of traits and not pointing to a node such as the recovery code input field.