<@U04UQ68083H> how can I access the authentication...
# ory-copilot
l
@chilly-king-10285 how can I access the authentication method by a user in a registration webhook?
b
A message from kapa.ai
To access the authentication method used by a user in a registration webhook, you need to examine the
method
field in the webhook payload. This field indicates which authentication method was used during registration. According to the [Ory API Reference](https://www.ory.sh/docs/reference/api), the
method
field can have different values depending on the authentication method used: -
"password"
for password-based registration -
"oidc"
for OpenID Connect registration -
"webauthn"
for WebAuthn registration -
"code"
for code-based registration -
"passkey"
for passkey registration When setting up your webhook, you can configure it to receive this information. Here's an example of how you might structure your webhook configuration:
Copy code
yaml registration:   after:     hooks:       - hook: web_hook         config:           url: "<https://your-webhook-endpoint.com>"           method: "POST"           body: "<base64://your-jsonnet-template>"
In your Jsonnet template, you can access the
method
field to determine which authentication method was used. For example:
Copy code
jsonnet function(ctx) {   method: ctx.flow.active,   // Other fields you want to include }
Remember that the exact structure of the webhook payload may vary depending on your Ory configuration and the specific version you're using. Always refer to the most up-to-date [Ory documentation](https://www.ory.sh/docs/) for the precise payload structure and available fields.