mirror of
https://github.com/binwiederhier/ntfy.git
synced 2026-05-09 16:35:53 +02:00
[GH-ISSUE #1018] Self Hosted ntfy Server with Basic Auth (via Nginx Reverse Proxy) not supported via Mobile App #714
Labels
No labels
ai-generated
android-app
android-app
android-app
🪲 bug
build
build
dependencies
docs
enhancement
enhancement
🔥 HOT
in-progress 🏃
ios
prio:low
prio:low
pull-request
question
🔒 security
server
server
unified-push
web-app
website
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/ntfy#714
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @caronc on GitHub (Feb 7, 2024).
Original GitHub issue: https://github.com/binwiederhier/ntfy/issues/1018
🐞 Describe the bug
I could be doing something wrong I'm sure, but I've got a ntfy deployed on my home server and it works great because I've set up the Nginx
basic authto not be applied from requests from my local network.However when I leave my home and my IP is now one from a nearby tower (or any external one), basic auth doesn't appear to work correctly using the mobile app, but I can easily point to my hosted service through the browser and authenticate without any issue (so configuration wise, i feel as though i'm good).
I was hoping the logic would simply be:

https://user:pass@my.ntfy.serverBut this just turns into a

Reconnecting...setup until i return back into my local network.How can the mobile app recognize Basic Auth?
💻 Components impacted
Android App
💡 Screenshots and/or logs
Screenshots shown above
🔮 Additional context
n/a
@Torxgewinde commented on GitHub (Feb 24, 2024):
Just my two cents:
AFAIK for HTTP-Basic-Auth the credentials go in a separate menu, this should be similar to this screenshot:

Please also note, that the endpoint "/file/" must not have HTTP-basic-auth enforced by the reverse-proxy: https://github.com/binwiederhier/ntfy/issues/893#issuecomment-1731314679
@caronc commented on GitHub (Feb 24, 2024):
Thanks for your post, unfortunately That didn't work. 😔
I would additionally upgrade this bug to include http-auth for files too then. Exposing ntfy to the internet with file upload access wide open is not ideal under any circumstance.
@Torxgewinde commented on GitHub (Feb 24, 2024):
I add the
server.ymland thehaproxy.confconfig i am using. In my setup it works well and indeed blocks/redirects unauthenticated users. The/file/endpoint is not used for uploading, just for downloading AFAIK and the filename is changed to same random string which serves the same purpose as a token or additionalAuthentication:header.In addition i also configured the same user in NTFY, so both (Reverse-Proxy and also in addition NTFY) check if the user is valid.
HTH
haproxy.conf
@caronc commented on GitHub (Mar 10, 2024):
My request is to support
basic authat a global level. This allows users who want to add their own security around their self hosted version of ntfy.sh to do so.I'm just trying to park my instance behind a secure reverse proxy i manage. I want to store the basic auth credentials in the connection info just like other platforms allow.
I get that there are individual topics built in with an internal user list controlled through ntfy, but that restricts me from leveraging PAM or other amazing centralized solutions you get from keeping auth outside of ntfy and one layer back.
My request: please just support basic auth in the connection string. All requests should just include the header from that point forward (including files)
@gitterspec commented on GitHub (Apr 2, 2024):
I agree that auth should additionally be supported through the URL (i.e. https://user:pass@host). UnifiedPush apps create a random topic anonymously, so the current auth implementation can't be used, but auth through the URL would allow adding protection if desired.
@kkarhan commented on GitHub (Nov 20, 2024):
I agree with @caronc since things like basic, server-wide auth is desireable and supporting that even rudimentary is quite useful.
@kkarhan commented on GitHub (Nov 20, 2024):
This is espechally important since the App doesn't support proxy configurations so one can't simply use i.e. Orbot and do Cookie Auth on Tor...
@binwiederhier commented on GitHub (Dec 29, 2025):
Custom HTTP headers will be supported in the 1.21.x release. See https://github.com/binwiederhier/ntfy-android/pull/146 for screenshots.