ory / kratos

Next-gen identity server replacing your Auth0, Okta, Firebase with hardened security and PassKeys, SMS, OIDC, Social Sign In, MFA, FIDO, TOTP and OTP, WebAuthn, passwordless and much more. Golang, headless, API-first. Available as a worry-free SaaS with the fairest pricing on the market!

Home Page:https://www.ory.sh/kratos/?utm_source=github&utm_medium=banner&utm_campaign=kratos

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

metada_admin not available in post registration hook payload

trautonen opened this issue · comments

Preflight checklist

Ory Network Project

No response

Describe the bug

In 1.1.0 (#3192) modifying metadata_admin on webhooks was fixed, but when receiving the payload in after hooks the metadata_admin does not exist anymore.

Reproducing the bug

Create after registration hook such as:

    registration:
      ui_url: http://127.0.0.1:3000/registration
      lifespan: 1h
      after:
        password:
          hooks:
            - hook: web_hook
              config:
                url: http://127.0.0.1:3000/webhooks/after-registration
                method: POST
                body: file:///etc/config/kratos/after_registration_hook.jsonnet
                response:
                  ignore: false
                  parse: false

with jssonet after_registration_hook.jsonnet

function(ctx) {
  userId: std.get(ctx.identity, 'id'),
  ctx: ctx
}

Inspect the ctx payload and see that it does not contain metadata_admin field in identity at all even if you set in in before hook and can inspect directly from database that it is there.

Relevant log output

No response

Relevant configuration

registration:
      ui_url: http://127.0.0.1:3000/registration
      lifespan: 1h
      after:
        password:
          hooks:
            - hook: web_hook
              config:
                url: http://127.0.0.1:3000/webhooks/after-registration
                method: POST
                body: file:///etc/config/kratos/after_registration_hook.jsonnet
                response:
                  ignore: false
                  parse: false

Version

1.1.0

On which operating system are you observing this issue?

None

In which environment are you deploying?

None

Additional Context

No response