Optional reverse-proxy (forward-auth) authentication mode#2
Open
lucas19919 wants to merge 1 commit into
Open
Conversation
Add AUTH_MODE=proxy to delegate authentication to an authenticating reverse proxy in front of OpenLeads (Authelia, Authentik, oauth2-proxy, Pomerium, Cloudflare Access, ...). It reads the user and optional groups from configurable headers, verifies a shared-secret header to prevent spoofing, provisions the user on first sight (no password), and maps a group to the admin role. The built-in login form is disabled in this mode. Default stays AUTH_MODE=password, so existing installs are unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
lucas19919
force-pushed
the
feat/proxy-forward-auth
branch
from
July 25, 2026 10:57
64845f9 to
15d6025
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds an optional
AUTH_MODE=proxythat delegates authentication to an authenticating reverse proxy in front of OpenLeads, so the app can sit behind SSO/MFA without implementing OAuth itself. Works with any forward-auth proxy (Authelia, Authentik, oauth2-proxy, Pomerium, Cloudflare Access, …).Behaviour
AUTH_MODE=password(default) — unchanged: the built-in login form + local accounts.AUTH_MODE=proxy— trusts the identity the proxy forwards in headers:No cookie/session in proxy mode — the proxy owns the session; identity is re-read per request.
Config
All new vars are documented in
api/.env.exampleanddocs/SETUP.md, and default to the widely-usedX-Forwarded-*header set. Nothing is tied to a specific proxy.Tests
New
api/src/proxyAuth.test.ts(7 cases: secret enforcement, JIT provisioning, group→role mapping, role re-sync, password-login disabled for provisioned users). Full suite green (145/145); web typechecks clean.🤖 Generated with Claude Code