When Open WebUI trusted header authentication fits and what makes it safe
Trusted header authentication suits an organization that already signs users in at a reverse proxy or identity provider, such as oauth2-proxy, Authentik or Authelia, and wants Open WebUI to accept that identity without a second login. The pattern is safe only when the proxy overwrites identity headers on every request and nothing can reach Open WebUI except through that proxy. If either condition fails, any client that can send a request can claim to be any user, so the design is a network and proxy control first and a login setting second.
Before choosing this path, confirm whether a native connection is the better first choice. Open WebUI documents single sign-on through OIDC and LDAP, which keeps Open WebUI in charge of validating credentials and tokens rather than trusting headers from another component. Review the current SSO options in the Open WebUI SSO documentation, and check the feature list on the Open WebUI features page to confirm how trusted header sign-in is configured in the release you plan to run. If your identity provider already speaks OIDC, a native connection usually leaves fewer places for a misconfigured proxy to create an exposure.
Choose trusted headers when the proxy is already a required control in your architecture, for example for access policies, MFA or device checks that you cannot move elsewhere. Then confirm three things with your team: which headers the proxy sets for email and name, whether it strips any client-supplied copies of those headers, and whether Open WebUI can be reached directly on its container port from other hosts or pods. Treat the answers to those questions as the acceptance criteria for the rest of this page, and plan a forged-header test as part of go-live rather than as an afterthought.
How a trusted header request flows from the proxy to Open WebUI
The diagram starts with a client request arriving at the edge proxy, which is oauth2-proxy, the authentik outpost or Authelia. The proxy first removes any identity headers the client sent, then authenticates the user and injects its own identity headers before forwarding. Open WebUI listens only on localhost or a private network, so the proxy is the sole path in. The trust boundary sits between the proxy and Open WebUI: anything that reaches Open WebUI without passing through the proxy must be treated as forged.
Trusted header flow, showing where forged headers are removed and where they could enter.
Choosing oauth2-proxy, authentik or Authelia as the header source
This table compares oauth2-proxy, authentik and Authelia as the component that signs users in and passes identity headers to Open WebUI. Read each row against the project documentation for your chosen version, and use the last column to favor the proxy your team already operates. The main takeaway is that the proxy choice matters less than whether its header behavior and session handling are confirmed and tested.
| Question | oauth2-proxy | authentik proxy provider | Authelia |
|---|---|---|---|
| Role in the setup | Standalone reverse-proxy authenticator that sits in front of Open WebUI and forwards identity headers | Proxy provider type in authentik, served through an embedded outpost that sits in front of the application | Authentication portal that gates requests at a reverse proxy and returns identity details to the upstream |
| Header names to confirm | Confirm the user, email and group header names and whether they are set only after successful sign-in in your version | Confirm the header names the outpost sends and the attributes mapped into them in your authentik release | Confirm the remote user and group header names and how the portal sets them for each protected route |
| Session handling to confirm | Confirm cookie scope, refresh behavior and what happens to the session when the upstream identity provider signs a user out | Confirm session lifetime and logout behavior between the outpost and the application, since sign-out does not automatically clear Open WebUI tokens | Confirm session storage, expiry and the cookie domain settings used with your reverse proxy |
| Upstream configuration to confirm | Confirm how the upstream value and pass-through headers are set and whether client-supplied identity headers are overwritten | Confirm how the application is bound to the provider and which proxy mode is used for header injection | Confirm the access control rules that protect the Open WebUI host and whether the portal can be bypassed by direct requests |
| Who needs to run it | Team that already operates a reverse-proxy authenticator or wants a single-purpose gate | Team that already runs authentik for SSO and wants one identity platform for other applications | Team that already operates Authelia behind a reverse proxy and wants policy rules in one file |
| Documentation to read first | The oauth2-proxy project documentation for your release, including its header and session settings | The authentik provider documentation and the release notes for your installed version | The Authelia documentation for your release, including its proxy integration and session settings |
| Overlap with existing estate | Check whether a current instance already protects other internal sites before adding a second gate | Check whether authentik is already the identity source for your directory and MFA policies | Check whether Authelia already gates other services, since one portal can serve several applications |
| Test before choosing | Send forged identity headers directly to Open WebUI and confirm they are overwritten or rejected | Run the same forged-header test through the outpost path and the direct path to the application | Run the same forged-header test and confirm that direct access to the upstream is blocked |
Why a forged header becomes a forged login
Open WebUI trusts whatever identity header reaches it. In trusted header mode, the application does not check a password or session of its own for that sign-in. It reads the user identity from a request header that the reverse proxy or identity proxy is expected to set after authenticating the user. That design only holds if every request to Open WebUI has passed through the proxy first. Any client that can reach Open WebUI directly can send the same header with any value it likes and sign in as any user it names, including an administrator.
Two gaps usually create this exposure. The first is a proxy that appends client-supplied headers instead of replacing them. If a request arrives with an identity header from the browser and the proxy adds its own value after it, the application may read the attacker's value first. The proxy configuration must overwrite or strip the identity headers on every inbound request before it authenticates the user. The second gap is a listener that is reachable on a host or pod network address. Open WebUI may be bound to all interfaces by default in a given install method, so anything on the same network, a neighboring container or a misrouted ingress rule can bypass the proxy entirely. Confirm the bind address and the published port in your own Docker Compose file, Helm values or service definition, not only in the proxy config.
The risk grows when the administrator account is matched by email address. If the header carries an email value and Open WebUI maps that value to an account, a forged header naming the admin's email gives the attacker the admin role without any password. The consequence is account takeover of whichever user the header names, with access to that user's chats, shared resources and, for admins, configuration and user management. Before go-live, decide which header field identifies users, confirm which account is the first administrator, and run a test that sends a forged header from outside the proxy path. Confirm current header names and admin behavior against the Open WebUI SSO documentation for your release.
Proxy and network controls that make header trust hold
Trusted header sign-in is only as strong as the path that delivers the headers. The controls below keep identity headers under the proxy's control, keep Open WebUI unreachable except through that proxy, and make failures visible. Each card names a check your team can run before go-live and repeat after every change.
Strip client identity headers at the edge
Configure the reverse proxy to remove every identity-bearing header a client sends before the request reaches the authentication step. Clients must never be able to supply the user identity, group or role headers that Open WebUI trusts. Check this by sending a request through the public hostname with each identity header set to an arbitrary user and confirming Open WebUI signs in as the proxy's user or rejects the request. Keep the list of stripped headers in version control so it is reviewed with every proxy change.
Set identity headers only from the session
The proxy should write identity headers only after it has validated the session with the identity provider, using values taken from that session rather than from the request. Confirm that unauthenticated requests reach Open WebUI with no identity headers at all, and that the header values change when you sign in as a different user. Document which proxy directive or middleware sets each header so a reviewer can trace every value back to its source.
Bind Open WebUI to localhost
Run Open WebUI so its listener accepts connections only from the proxy, either on the loopback interface or on a private address used just by the proxy. A listener on all interfaces lets anyone who reaches the host skip the proxy entirely and supply their own headers. Verify the binding with a socket listing on the host and by confirming that a connection to the container or host address from another machine is refused.
Block direct access to the Open WebUI port
Add a host or network firewall rule that drops traffic to the Open WebUI port from anywhere except the proxy, so the binding is not the only barrier. This matters in container setups, where publishing a port can expose it on all interfaces regardless of the application setting. Test from a machine outside the proxy's network and from inside the cluster, then record the rule set alongside the deployment configuration.
Log rejected and unexpected header values
Log requests that carry identity headers from outside the proxy, requests that fail header validation and any change in the set of headers the proxy sends. These events are the early signal of a bypass attempt or a misconfigured route. Confirm the logs record the source address, route and timestamp without copying session tokens or chat content, and that someone receives an alert for a sustained spike. Send a test forged request and check that it appears in the log.
Keep the proxy on a supported line
Trusted header handling depends on the proxy's behavior, so a proxy release that changes header parsing or the way it forwards requests can silently reopen a bypass. Record the proxy version in use, check the project's security policy and release notes for supported lines, and schedule upgrades so the proxy stays on a supported line. Re-run the forged header test after every proxy upgrade before returning the route to service.
Setting up trusted header sign-in in the right order
This sequence sets up trusted header sign-in so that Open WebUI accepts identity only from the proxy, and each step ends with a check you can record. Work through it on a test instance before changing production. The result is a configuration you can explain to an auditor and retest after each upgrade.
Confirm the version and trusted header settings
Check which Open WebUI version you run against the project's releases page, and read the trusted header section of the Open WebUI documentation for that exact version. Record the setting names, their defaults and the header names they expect, because these can change between releases and must match what your proxy sends. If the documentation for your version differs from the latest pages, confirm the behavior with the project or on your own test build. Done when you have a written record of the version, settings and header names that every later step refers to.
Define the identity attributes the proxy sends
Decide which attributes the proxy will send: a unique identifier such as email, a display name and, if roles come from directory groups, a group claim. Choose one identifier and make sure users cannot change it in their own profile. Confirm each claim exists in your identity provider and that the proxy passes it under the header name Open WebUI expects. Check by signing in as a test user through the proxy and inspecting the headers that arrive at Open WebUI from the proxy's logs. Each value should match the directory record exactly.
Configure the proxy and its session lifetime
Configure oauth2-proxy, the Authentik proxy provider or Authelia so that it removes any identity headers sent by the client before it adds its own. Set the session lifetime to a value your policy allows and record it. Without Redis, Open WebUI sign-out does not revoke tokens, which stay valid until they expire, by default after 4 weeks, so plan the proxy session and Open WebUI token lifetimes together. Check by sending a request with a spoofed identity header through the proxy and confirming that Open WebUI sees only the proxy's value.
Bind Open WebUI to a private address
Configure Open WebUI's listener so it accepts connections only on a loopback or internal interface that the proxy can reach, and record the bind address from your startup settings. Do not treat the proxy as the only barrier. Check from a host other than the proxy: a direct connection to the Open WebUI port should be refused or time out, while the same connection through the proxy succeeds. If Open WebUI runs in a container, run the same check on the network the container joins.
Lock down the published port
Remove any public publishing of the Open WebUI port in your Compose file, Kubernetes service or load balancer, so that only the proxy's listener is reachable by users. Apply firewall or security group rules that match this design. Check from outside your network: a port scan should show the proxy's HTTPS port and no Open WebUI port. Repeat the check after every change to port mappings, ingress rules or container network mode, because one leftover publish mapping lets clients reach Open WebUI without passing through the proxy.
Sign in as a test user
Sign in through the proxy with a non-admin test account and confirm the account is created with the expected email and name. Sign out and confirm that the session ends at the proxy. Then send a request with a forged identity header that carries the test account's name but a different email, both directly to Open WebUI and through the proxy. The direct request should fail, and the proxy path should keep the proxy's identity. Check the user list in Open WebUI: only the test identity should appear.
Confirm the admin role mapping
Confirm that only members of the designated admin group receive the admin role, and that a regular user who sends a forged admin group header remains a standard user. Check the role on each test account in the admin user list. Then remove a test user from the admin group in the directory, sign in again and confirm the role drops at the next sign-in. Confirm the exact role-sync behavior for your version in the documentation. Record which group is the admin source so later membership changes go through review.
How the setup changes on one host, several replicas or Kubernetes
On one host, the simplest safe layout keeps Open WebUI off the network and lets only the authentication proxy reach it. The proxy and Open WebUI share the host, the Open WebUI port is bound to the loopback interface, and the proxy is the only component that listens on a public address. Because the proxy is the sole route in, Open WebUI can trust the identity header it receives, as long as nothing else on the host can reach the bound port.
- Bind to loopback: Publish the Open WebUI port as
127.0.0.1:8080:8080in Compose so that other hosts and containers outside the Compose network cannot connect directly. - Keep the proxy on the same host: Run oauth2-proxy, Authentik or Authelia as a container in the same Compose project or on the same host, and point its upstream at the loopback-bound port.
- Strip client headers at the proxy: Remove any inbound identity header from browser requests before the proxy sets its own, so a user cannot supply a forged value.
- Use local storage for SQLite: A single replica can keep SQLite, but the database file should sit on locally attached SSD or NVMe storage rather than network storage.
- Accept that tokens expire without Redis: With one instance there is no Redis, so signing out does not revoke tokens, which stay valid until they expire, by default after 4 weeks.
Before go-live, confirm that a request to the host's public address on the Open WebUI port is refused and that a request with a spoofed header fails through the proxy.
Multiple replicas change the state model. The scaling guide requires PostgreSQL instead of SQLite for multi-instance deployments, because SQLite does not handle concurrent writes from several processes well. Each replica must also see the same sessions, websocket connections, uploads and knowledge, so the trusted header design depends on shared infrastructure as well as on the proxy.
- PostgreSQL for shared data: Move the database to PostgreSQL before adding a second replica, since multi-instance deployments require it.
- Redis for sessions and websockets: Deploy Redis as the shared state store for sessions, websocket connections and application state. Without it, signing out does not revoke tokens.
- Shared file storage: Uploads and knowledge must be reachable from every replica, so use shared storage that all instances mount.
- External vector database: The default ChromaDB will crash in multi-process setups, so use an external vector store when running several workers or replicas.
- Proxy in front of every replica: Point the proxy at a single load-balanced address, and confirm that no replica address is reachable without going through it.
Retest sign-out on two replicas: a session ended on one should stop working on the other, and a token issued before sign-out should be rejected. If it is not, Redis is missing or not shared correctly.
In Kubernetes the proxy must be the only ingress path to Open WebUI. A Service of type ClusterIP exposes Open WebUI inside the cluster, and an Ingress or gateway routes external traffic to the proxy, which then forwards to that Service. If an Ingress rule, a NodePort or a LoadBalancer also exposes the Open WebUI Service directly, a client can send forged identity headers and skip the proxy entirely.
- Single ingress path: Route the public hostname only to the proxy Service, and remove or avoid any Ingress that points at the Open WebUI Service.
- Network policy: Apply a NetworkPolicy that allows ingress to the Open WebUI pods only from the proxy pods, so other pods in the namespace or cluster cannot reach the Service.
- Shared backing services: Use PostgreSQL, Redis and shared storage as described for multiple replicas, since Helm-based deployments scale by replica count.
- Confirm the cluster network plugin enforces policy: NetworkPolicy has no effect unless the cluster's network plugin enforces it, so confirm this with your platform team.
- Protect the forwarded identity: Ensure the ingress controller strips identity headers from client requests before the proxy sets them.
Test from a pod in another namespace and from a pod without the proxy label. Both requests should fail to reach Open WebUI, and a forged header sent through the public route should be overwritten or rejected.
Operational risks to plan for after go-live
Trusted header sign-in depends on three moving parts: the proxy, Open WebUI and the identity provider. Each one changes on its own release cycle, and the risks below sit where those cycles meet. Review them at go-live and again at every upgrade.
Proxy upgrades that change header behavior
A new proxy release can alter how it sets, forwards or strips identity headers, or change default trusted-proxy settings. If the stripping rule for client-supplied headers stops applying, forged identity returns without any change on the Open WebUI side. After every proxy upgrade, confirm the header rules still apply and run the forged-header test against the new build. Keep the proxy configuration in version control so differences are visible in review.
Session lifetime mismatches
The proxy session, the identity provider session and the Open WebUI token can each expire on different schedules. A user may still be signed in at the proxy while Open WebUI has expired its token, or the reverse, which produces confusing sign-in loops or stale access after a role change. Write down the lifetime of each layer and test what happens when one expires before the others. Confirm with your proxy and identity provider documentation which setting governs each layer.
Token validity after sign-out
Without Redis, signing out of Open WebUI does not revoke tokens. They stay valid until they expire, by default after 4 weeks, so a sign-out on a shared workstation does not end access for that token. Decide whether to shorten token lifetime, add Redis for multi-replica deployments, or both. Test sign-out explicitly, then confirm the token is rejected after a new session starts elsewhere.
authentik moved from Redis to PostgreSQL
The authentik 2025.10 release removed Redis and moved caching, tasks, sessions and WebSocket functions to PostgreSQL. The release notes warned of roughly 50% more PostgreSQL connections after upgrading. If authentik sits in front of Open WebUI, size the database connection limits and pooling before upgrading across that release, and watch connection counts after the change.
Supported authentik version windows
The authentik security policy lists 2026.5.x and 2026.8.x as the versions receiving security fixes at the time of writing. An authentik version outside those windows may stop receiving security patches, which matters when it handles the sign-in path for Open WebUI. Record the running version, check the security policy on a schedule, and ask your team who owns upgrades before a version leaves support.
- Supported authentik lines
- 2026.5.x, 2026.8.x
Security releases with 24 hours notice
The authentik project announces security releases at least 24 hours in advance. That window is short, so the team must be reachable and have a staging path ready before it passes. Subscribe to the authentik releases feed, assign a named owner for security notices, and rehearse an out-of-cycle upgrade in a test environment. Scheduled header-forgery retests after each upgrade confirm the sign-in path still holds.
authentik security policyQuestions teams ask before trusting headers from a proxy
How much does it cost to secure trusted header sign-in behind a proxy?
The cost comes from labor and licensing, and the software itself is free to use. Open WebUI is open source, and the proxy (oauth2-proxy, Authentik or Authelia) can be run without a license fee. The main costs are the hours to configure the proxy, strip client headers, bind Open WebUI to localhost, and test for forged headers, plus the time your identity and network staff spend reviewing the result. Costs rise with the number of proxies, the number of applications behind the same identity provider, and how many environments need the same controls. Ask any partner for a quote built from a written scope that lists each system, environment and deliverable. DeployOpen does not publish a price list, and a quote follows from that scope.
How long does a first trusted header setup take?
The duration depends on how many components are already in place and how well they are documented. A team with a working identity provider, a proxy already in front of Open WebUI, and a staging environment usually needs less time than a team building all three from scratch. The work includes proxy configuration, header stripping rules, localhost binding, a documented sign-in flow and a retest after changes. Confirm the timeline in writing with any provider, and ask what is assumed about existing infrastructure, change windows and access to test accounts.
What does our team need to provide for this work?
Three groups of people are usually needed. Proxy operators need to supply the current reverse proxy or ingress configuration and access to change it. Network staff need to confirm which paths reach Open WebUI, which ports are exposed and whether any other route can bypass the proxy. An identity owner needs to confirm which claims or attributes the identity provider sends, which groups map to Open WebUI roles, and who approves changes to sign-in. Without these people available during the work, the setup stalls at the points where a wrong assumption would create an access gap.
Can our own team set up trusted header sign-in without a partner?
A team with experience running a reverse proxy and an identity provider can do much of this work in-house. The hard parts are verifying that the proxy overwrites or removes every client-supplied identity header, confirming that Open WebUI cannot be reached directly, and testing forged headers from outside the trusted path. Teams that lack one of these skills, or that cannot run an independent test, often benefit from a fixed-scope engagement that adds a review and a retest. Decide by checking whether someone on your team can explain, with evidence, why a request with a forged header is rejected from every route.
Which authentik edition do we need for this setup?
The authentik Open Source edition is free and is the basis for proxy-based sign-in in many deployments, so an Open Source setup needs no license fee. The authentik pricing page lists an Enterprise edition at $5 per user per month billed annually, plus $0.02 per external user per month. It lists Enterprise Plus starting at $20k annually. Enterprise-only features on that page include Google Workspace and Microsoft Entra ID integrations, mTLS client certificate authentication and enhanced audit logging. Check the authentik pricing page and the LICENSE on GitHub before you choose, because the repository states that code in the enterprise directory uses a separate license.
What should a retest of forged header handling include?
A retest should repeat the original forged header tests after every change to the proxy, identity provider or Open WebUI version. It should send requests with identity headers such as user, email and group values through every route that reaches Open WebUI, including direct connections to the container port, alternate hostnames and any internal service paths. It should confirm that the proxy strips those headers from client traffic, that Open WebUI is bound to localhost or a private interface, and that sign-out and session expiry behave as expected. The retest should produce a written record of each test, its result and the evidence behind it.
How is the scope of the work agreed?
Most engagements are fixed-scope, so the systems, environments, deliverables and timelines are agreed in writing before any work starts. For trusted header work, the scope should name the proxy, identity provider and Open WebUI environments, the header and route tests to be run, the documentation to be delivered and the retest after changes. It should also state what the client team must provide and what is excluded, such as changes to the identity provider's own policies. Ask for the written scope before you compare offers, because it is the basis for any quote.
Limits and what to confirm in your environment
Trusted header sign-in depends on details that change between Open WebUI versions, proxies, identity providers and editions. The cards below list what to confirm in a test environment before production, and who to ask when the answer is not in the documentation.
Exact trusted header settings
Confirm the trusted header names, the accepted values and the behavior for missing or empty headers in the Open WebUI version you run. Check the release notes for your exact version before copying settings from older guides, since header handling can change between releases. The current line includes v0.12.3, published October 16, 2026, so start by reading its notes on the releases page.
Open WebUI releasesProxy header and session behavior
Test whether oauth2-proxy or Authelia strips client-supplied identity headers before forwarding requests, and whether they set the user name, email and group headers you need. Confirm how each handles session expiry, logout and token refresh, because Open WebUI trusts the header on every request. Ask the proxy maintainers or vendor which headers they overwrite rather than pass through.
authentik edition and proxy features
Confirm that your authentik edition includes the proxy provider and the outpost features you plan to use. The pricing page separates the Open Source tier, which lists community Discord support only, from paid editions, so check the feature table against your design. Ask the vendor in writing which features are included at your user count.
authentik pricingIdentity source attributes
Verify that your directory or identity source can supply the email, name and group attributes Open WebUI needs for account matching and role mapping. Missing or changing attributes can create duplicate accounts or wrong permissions. Test with a sample of real account types, including service accounts and contractors, in a non-production tenant.
Need for mTLS or other enterprise features
Decide whether your design needs client certificate authentication, enhanced audit logging or other enterprise-only identity features. Check whether these are available in your edition before you commit to a design that depends on them, and ask the vendor for a written statement of inclusions. Plan a fallback if the feature is not in your license.
Replica count and shared state
Confirm whether you will run more than one Open WebUI replica. The scaling guide requires Redis for shared session state across replicas, and without it, signing out does not revoke tokens, which remain valid until they expire, by default after 4 weeks. Test sign-out and header-based session behavior on every replica before going live.
Scaling Open WebUIHow DeployOpen scopes and tests trusted header sign-in
DeployOpen plans, implements, hardens and documents trusted header sign-in for Open WebUI inside your own infrastructure, with the proxy, identity provider and application configured together. Engagements are fixed-scope, with scope, deliverables and timelines agreed in writing before work starts.
How we scope
- Map which identity provider, proxy and Open WebUI version your team runs before defining the work
- Agree in writing which headers the proxy strips, forwards and sets, and which users may sign in
- Confirm whether the engagement adds forged-header testing, documentation and a retainer for ongoing support
How we build
- Configure the reverse proxy to remove client-supplied identity headers before the request reaches Open WebUI
- Bind Open WebUI to localhost so traffic can only arrive through the authenticated proxy path
- Test forged header requests from outside the proxy and retest after every configuration change
How we hand over
- Deliver the proxy, identity provider and Open WebUI configuration with a record of each setting and its reason
- Document the header contract, the test cases used and the expected results for each one
- Walk your platform and security teams through the runbook for changing identity providers or upgrading Open WebUI
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer after the initial handover
- Retest trusted header paths when Open WebUI, the proxy or the identity provider is upgraded
- Review changes to header handling with your team before they reach production

