This is a feature request for ntfy, an open-source push notification system, to add OpenID Connect (OIDC) for user authentication. The user wants to integrate ntfy with their existing OIDC setup, avoiding separate local accounts. This would allow ntfy to be used in home lab environments or small multi-user setups that already leverage OIDC.
A starter prompt for Claude Code, what you'll need, and how to reach them.
You are an expert Go developer. Your task is to implement OIDC (OpenID Connect) user authentication for the ntfy server, as requested in GitHub issue #1596 (https://github.com/binwiederhier/ntfy/issues/1596). The core requirement is to allow users to authenticate with an OIDC provider instead of managing local ntfy accounts.
Here's the plan:
1. Fork the existing `ntfy` repository (GoLang).
2. Identify the current authentication flow and where to integrate OIDC.
3. Use `go-oidc` (or a similar robust Go OIDC client library) to manage the OIDC flow.
4. Implement the OIDC authorization code grant flow. This includes:
a. Redirecting users to the OIDC provider's authorization endpoint.
b. Handling the callback from the OIDC provider, exchanging the authorization code for tokens.
c. Verifying the ID token and extracting user information.
d. Establishing a secure session for the authenticated OIDC user within ntfy.
5. Add server-side configuration options for `OIDC_ISSUER_URL`, `OIDC_CLIENT_ID`, `OIDC_CLIENT_SECRET`, and optionally `OIDC_SCOPES` and `OIDC_REDIRECT_URL`.
6. For the MVP, focus on a basic web-based login flow, not command-line or mobile client OIDC, initially.
7. Ensure that existing local account authentication remains functional alongside the new OIDC option.
8. Provide clear instructions for setting up OIDC authentication in the `README`.
Build/Verify Gate: A fully functional ntfy server that allows users to log in successfully using an OIDC provider (e.g., Keycloak, Google) and send push notifications with their OIDC-authenticated session. The solution should be robust, secure, and maintainable.:bulb: **Idea** I really like how OIDC is getting more and more used even in home setups. Im using it too for most of my services since i support a whole family with access to different services. I really want to move from Telegram Bots for notifications to a dedicated push notification system (because telegram annoys me). But i dont want to have local accounts on my nfty server when every other system uses oidc. I would love to have oicd for auth in nfty. :computer: ntfy server
Access to public GitHub repository.
Standard Go development setup.
New: configuring an OIDC client application in a provider like Keycloak or Google - ~half a day.
Learn it: Search getting-started ↗
Get set up: Create the account/instance, generate the API key or credentials, and add them to your project's environment variables.
New: Deep dive into OIDC authorization code flow, token verification, PKCE - ~1-2 days.
Learn it: Search getting-started ↗
Comment on the GitHub issue #1596 (https://github.com/binwiederhier/ntfy/issues/1596), then open a draft Pull Request to `binwiederhier/ntfy`.
“I've built a working prototype of OIDC authentication for ntfy, addressing issue #1596, and am ready to submit a PR. This integrates with standard OIDC providers and adds flexible configuration, offering a modern auth solution for users with existing OIDC setups.”
Open the original ↗