goauthentik / goauthentik/authentik

Event dict in webhook mapping

Open
#17,312 1 comment 0 reactions 1 assignee Claimed by @dewi-tik View on GitHub
area:docs needs_documentation question
Dominant language
Python
Stars
25.6k
Forks
2k
Avg merge
1d 2h
Merged PRs (30d)
659

Description

I am trying to enable webhook notifications to telegram for when someone logs in successfully or fails login. I've set up the transport, the notification rules, it triggers the notification successfully on logins and fails.

What I am missing is how to add more info to the webhook payload? I want to add the client IP for failed logins, for example, among other things.
I tried making a custom webhook mapping, and extracting info from request.context.event, but event dict doesn't seem to be available in this scope.

In the documentation there is only a single example that uses request.context['notification']. That doesn't contain the info I need.
Is there a way to get the event here and access that info?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.