Hey guys! just looking for some help here: - Using...
# talk-kratos
b
Hey guys! just looking for some help here: • Using Ory Cloud • Having a post registration webhook pointing to our backend to persist the user there. When trying to register a new user, the web hook is correctly executed but when the backend side try to retrieve the created identity from Ory, it returns 404. Requesting all identities from Ory through admin endpoint result on
[]
, so no identities are been created. It works in local environment running Kratos in a docker container, so no clue here of what is happening in the Cloud version. This is the piece of the config file where the webhook is presented:
Copy code
registration:
      after:
        hooks: []
        oidc:
          hooks:
            - hook: session
        password:
          hooks:
            - config:
                body: file:///etc/config/kratos/body.jsonnet
                method: POST
                response:
                  ignore: false
                url: my-backend-url/user/registration
              hook: web_hook
            - hook: session
This is my jsonnet file:
Copy code
function(ctx) {
    type: 'after_registration',
    user_id: ctx.identity.id,
    identity: ctx.identity,
    flow: ctx.flow,
}
Ory is correctly being requested by my backend, the main issue here is seems like the identity is not persisted in Ory side then when my backend is trying to get the new identity, Ory is returning 404. @magnificent-energy-493 @steep-lamp-91158 @red-sugar-49451
m
Can you DM me or link your project slug here please?
s
That fails because the webhook runs before the identity is created. Why do you want to fetch it if you have it in the webhook request body anyways?
b
@steep-lamp-91158 just double checking that the identity is succesfully created before persist it in my side. According you told me, Kratos docker container behaves different from the Cloud version, because it works perfectly in my local environment.
s
hm no it should work exactly the same way