-
|
I ran in to the problem that I'm unable to update identity with settings after hook, seems that it ignores the response. Ory documentation says it should work:
https://www.ory.sh/docs/guides/integrate-with-ory-cloud-through-webhooks#modify-identities Did i mess up configuration or is it a bug? Kratos settings: ...
settings:
ui_url: http://localhost:3000/settings
privileged_session_max_age: 15m
before:
hooks:
- hook: web_hook
config:
url: http://localhost:4000/webhook/settings/before
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7IGN0eDogY3R4IH0=
response:
parse: true
after:
password:
hooks:
- hook: web_hook
config:
url: http://localhost:4000/webhook/settings/after/password/pre-persist
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7IGN0eDogY3R4IH0=
response:
parse: true
- hook: web_hook
config:
url: http://localhost:4000/webhook/settings/after/password/post-persist
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7IGN0eDogY3R4IH0=
response:
parse: false
profile:
hooks:
- hook: web_hook
config:
url: http://localhost:4000/webhook/settings/after/profile/pre-persist
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7IGN0eDogY3R4IH0=
response:
parse: true
- hook: web_hook
config:
url: http://localhost:4000/webhook/settings/after/profile/post-persist
method: POST
body: base64://ZnVuY3Rpb24oY3R4KSB7IGN0eDogY3R4IH0=
response:
parse: falseHandler code: @Post('/settings/after/password/pre-persist')
@HttpCode(200)
async afterSettingsPasswordPrePersistHook () {
this.logger.debug('Received Webhook: After Settings Pre Persist Password')
return { identity: {
metadata_public: {
test: 1
}
} }
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
|
Hello @bernessco What version of Ory Kratos are you running? It seems like you have correctly set up the hooks for the settings flow. However, there are a few things you might want to check: Response Parsing: In your configuration, you have set parse: true for the afterSettingsPasswordPrePersistHook webhook. This means that the webhook's response will be parsed and used to modify the identity. Make sure that your webhook is returning a 200 OK response with a JSON object containing the identity key. Identity Modification: According to the documentation, the values from the identity object in the webhook's response will be used to change the identity before it is saved to the database. In your case, you are trying to modify Webhook Execution: Ensure that your webhook is being executed correctly. You can check this by logging the request and response of the webhook. If you have checked all these points and the issue still persists, it might be a bug. In that case, you should consider opening a bug report with some info to reproduce. |
Beta Was this translation helpful? Give feedback.
-
|
Hi, @vinckr ! Should i report than this as bug? |
Beta Was this translation helpful? Give feedback.
Hey @bernessco
sure!
Please do a quick scan of the open issues if there is one open related to this before you open one.
Also I forgot to ask but you are on the 0.13.0 version+ and not running an older version?
We just released v1.0, please try it out on this version as well if possible, there was a lot of bugfixes.