feat(auth): trusted header authentication with profile binding (closes #3351)#3384
Open
Frankstar wants to merge 4 commits into
Open
feat(auth): trusted header authentication with profile binding (closes #3351)#3384Frankstar wants to merge 4 commits into
Frankstar wants to merge 4 commits into
Conversation
added 4 commits
June 2, 2026 08:27
Implements trusted header authentication for reverse-proxy setups (Authelia, Authentik, nginx auth_request, etc.): - HERMES_WEBUI_TRUSTED_AUTH_HEADER: header containing username - HERMES_WEBUI_TRUSTED_GROUPS_HEADER: header containing groups - HERMES_WEBUI_GROUP_PROFILE_MAP: maps groups to Hermes profiles - HERMES_WEBUI_TRUSTED_AUTH_PROXY_IPS: CIDR allowlist (security-critical) - HERMES_WEBUI_TRUSTED_AUTH_LOGOUT_URL: optional SSO logout URL Security features: - Proxy IP allowlist prevents header forgery attacks - Untrusted headers are stripped before auth decisions - Session auto-creation for trusted users - Profile binding via group→profile mapping
After check_auth() succeeds, auto-set session cookie for trusted-auth users and set the bound profile cookie when group→profile mapping matches.
- /api/auth/status now returns trusted_auth_enabled and trusted_auth_logout_url - /api/auth/logout now clears the profile cookie alongside the session cookie
- login.js: auto-redirect to app when trusted auth is active and session exists - panels.js: signOut() redirects to Authelia logout URL when configured
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.
Summary
This PR implements trusted header authentication for reverse-proxy deployments (Authelia, Authentik, nginx
auth_request, etc.), resolving #3351.When a reverse proxy handles authentication, the WebUI can trust headers sent by that proxy to identify the user and optionally bind them to a specific Hermes profile. This enables multi-user access with profile isolation without implementing a separate login system.
New Environment Variables
HERMES_WEBUI_TRUSTED_AUTH_HEADERRemote-UserHERMES_WEBUI_TRUSTED_GROUPS_HEADERRemote-GroupsHERMES_WEBUI_GROUP_PROFILE_MAPhermes_devops=devops,hermes_coworkers=coworkersHERMES_WEBUI_TRUSTED_AUTH_PROXY_IPS127.0.0.1,::1,10.0.0.0/8HERMES_WEBUI_TRUSTED_AUTH_LOGOUT_URLhttps://auth.example.com/logoutSecurity Design
HERMES_WEBUI_TRUSTED_AUTH_PROXY_IPS, the feature is disabledRemote-User/Remote-Groupsheaders from non-allowlisted IPs are deleted before auth decisionshermes_profilecookieAuthelia Example