Hi! I'm having an issue with Kratos what I think m...
# ory-selfhosting
a
Hi! I'm having an issue with Kratos what I think might be a bug, but I'm not sure. I'm using Kratos v1.3.0 and it's self-hosted. What I'm doing I have configured webhook call to be made after password login. I want to pass the session data (along with transient payload) to another system. The webhook's response section is configured with
parse: false
and
ignore: true
as it's just a notification to another system and I don't care about the response and it should not block the login flow. Problem I understand with this configuration the webhook call should be made after the session data has been persisted to DB on Kratos' side. The problem however is the session id is
00000000-0000-0000-0000-000000000000
when reading it from the session object in the webhook handler. Everything else is defined as it should but also in the
devices
array in the session object the device id is
00000000-0000-0000-0000-000000000000
. I was looking around if someone has had a similar problem and I found this issue - https://github.com/ory/kratos/issues/3340. Although it's about registration flow and about identity id the webhook configuration's suggestion should apply? Based on the suggestion in this issue I also have set
parse: false
in addition to setting
ignore: true
in my webhook config. I'm not using
can_interrupt
flag as it's deprecated. Also inside the after-password-login webhook handler if I make a an API call back to Kratos to fetch active sessions for the given user the session id and also the device id are defined in the sessions returned in the response. Do I have a wrong expectation for the session id to be defined with the actual session id and not
00000000-0000-0000-0000-000000000000
or is this not how it's supposed to work with given webhook configuration?
Still looking for clarity on this potential issue. 🤔 Anyone has any input on this?
s
sounds like a bug, can you maybe create an issue for that?
a
d
Hi @ancient-orange-15810, you didn't give us your jsonnet used for this hook that failed. Maybe it's just a jsonnet problem.
a
Hi! I added the webhook config together with the base64 encoded jsonnet to the github issue. Posting the decoded version to here as well.
Copy code
function(ctx) { session: ctx.session }
The hook itself didn't fail. All the data I defined in the jsonnet was there when receiving the webhook request on my server. The only issue was the session id (also including device id) was all zeros which I didn't expect as I configured this hook as async/post-persist and expected this webhook to be executed after the values have been persisted to DB.