binwiederhier / ntfy

Send push notifications to your phone or desktop using PUT/POST
https://ntfy.sh
Apache License 2.0
17.77k stars 691 forks source link

Webhook and Authentik usage for sending NTFY notifications with authorization #969

Closed SinghTaranjeet16 closed 9 months ago

SinghTaranjeet16 commented 9 months ago

Hi I need some with using webhooks with Authentik. I am setting up notification on Authentik with generic webhook option and using this command to send the message https://ntfy.sh/mytopic/publish?auth=<TOKEN> but it doesn't work .

Does NTFY webhooks work with Authentik even?

wunter8 commented 9 months ago

Is Authentik sending a GET request or a POST request? The .../publish URL expects a GET request.

Also, does it work if you (temporarily) disable auth? If so, it's a problem with your auth query param. The docs describe how to generate it with double base64 encoding

SinghTaranjeet16 commented 9 months ago

@wunter8 The auth parameter that I am using is indeed double base64 encoded. I have tried to send the /publish command using curl (or straight away typing it in browser )and get the notification on my device. So doesn't looks like that auth is the issue here. Secondly, looks like authentik sends a POST request https://goauthentik.io/docs/events/transports/

SinghTaranjeet16 commented 9 months ago

Worked by sending POST command directly to NTFY server topic, without the /publish paramter. So, for Authentik, command should be https://ntfy.sh/topic?auth=<token>