Add bearer/basic auth option to webhooks
Notifications > Webhooks section needs optional bearer/basic auth
What you need to do is to add two optional fields below Webhook URL:
- Authentication Type (dropdown):
- None (default)
- Basic Auth
- Bearer Token
If Basic Auth is selected, ask for:
- Username
- Password
If Bearer Token is selected, ask for:
- Token input field
That is it. Additionally when sending the webhook request, do the following:
-
For basic Auth:
- Encode username:password in base64.
- Add header: Authorization: Basic base64(username:password)
-
For bearer token, it's more simple.
- Add header:
Authorization: Bearer YOUR_TOKEN
- Add header:
I can start working on this @gorkem-bwl
Sure, please go ahead 👍
Since notifications have its own sidebar entry, this must be handled there.
There seems to be a lack of update on this. I'd be happy to contribute. @gorkem-bwl could you please elaborate a bit on what you consider "bearer/basic" auth?
There seems to be a lack of update on this. I'd be happy to contribute. @gorkem-bwl could you please elaborate a bit on what you consider "bearer/basic" auth?
Sure, I have updated the main issue now.
Is this issue still open, can I work on it??
Is this issue still open, can I work on it??
Hi Vinay. There is an open PR for this.
Even better would be to give user control over the headers of the webhook. Hey, maybe even give them control over the body!
Uptime Kuma did this perfectly (example of notifying via WhatsApp API):
@dvdl16 those are pretty good options. Once this issue is picked up and complete, we can do add custom body and additional options sections there so other platforms like Whatsapp can be covered.
Thanks @gorkem-bwl Fantastic project, looking forward to following along
Thanks @gorkem-bwl Fantastic project, looking forward to following along
Very well, thank you for your kind words Dirk.