Repository navigation
web: keep the web path in URLs the interfaces build - #27291
Conversation
Some URLs were built from the page's origin instead of the web base path, so with authentik under AUTHENTIK_WEB__PATH they pointed outside of authentik: the RAC tunnel websocket, the flow "Execute" buttons, invitation links, the AUTHENTIK_HOST shown in the outpost deployment info, and the event map, about dialog and email preview assets. The RAC websocket also missed the session cookie, which is scoped to the web path, so authentik refused it even where a proxy rewrote the path. Closes: #26803
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #27291 +/- ##
=======================================
Coverage 92.48% 92.48%
=======================================
Files 1197 1197
Lines 81116 81116
Branches 4497 4497
=======================================
Hits 75017 75017
Misses 6033 6033
Partials 66 66
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
Playwright e2eDownload this run's HTML report and traces, then open the report: gh run download 40803238204 -D playwright-artifacts
npx playwright show-report playwright-artifacts/playwright-reportInstallation instructionsInstructions for docker-composeAdd the following block to your AUTHENTIK_IMAGE=ghcr.io/goauthentik/dev-server
AUTHENTIK_TAG=gh-8a7725e4fb94eb5f23e5ab4d249fdc6ea57cc58e
# Distroless image: AUTHENTIK_TAG=gh-8a7725e4fb94eb5f23e5ab4d249fdc6ea57cc58e-distroless
AUTHENTIK_OUTPOSTS__CONTAINER_IMAGE_BASE=ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)sAfterwards, run the upgrade commands from the latest release notes. Instructions for KubernetesAdd the following block to your authentik:
outposts:
container_image_base: ghcr.io/goauthentik/dev-%(type)s:gh-%(build_hash)s
global:
image:
repository: ghcr.io/goauthentik/dev-server
tag: gh-8a7725e4fb94eb5f23e5ab4d249fdc6ea57cc58e
# Distroless image: tag: gh-8a7725e4fb94eb5f23e5ab4d249fdc6ea57cc58e-distrolessAfterwards, run the upgrade commands from the latest release notes. |
|
|
… to version-2026.8) (#27346) * Cherry-pick #27291 to version-2026.8 (with conflicts) This cherry-pick has conflicts that need manual resolution. Original PR: #27291 Original commit: c8585f5 * web: resolve cherry-pick conflicts for the web path fix toFlowInterface and the router interfaces module exist only on main, so the flow Execute buttons build their URL from globalAK().api.base like the rest of version-2026.8 does. * locale: add unstub to the software terms dictionary --------- Co-authored-by: Dominic Roy <[email protected]>
Details
What does this PR change?
URLs that the web interfaces build to reach authentik now start at the web base path instead of the page's origin:
ws/rac/<token>/) goes through a newwebsocketURLhelper, which the notifications websocket now uses too.toFlowInterface.AUTHENTIK_HOSTin the outpost deployment info.AUTHENTIK_HOST_BROWSERstays the origin, because outposts only take its scheme and host.staticURLhelper that mirrors the server'sStaticBackend.file_url.DefaultBrandandBrandFormkeep their/static/...defaults, because those are file names that the server resolves with the web path itself.Why is this change needed?
In #26803, the RAC page under
AUTHENTIK_WEB__PATH=/authentik/opened/ws/rac/<token>/. A reverse proxy that only serves/authentik/doesn't send that to authentik. Where the proxy rewrites the path, the browser still leaves out the session cookie, which is scoped to/authentik/, so authentik refuses the connection.The other URLs break the same way under a web path. Execute opened
/if/flow/<slug>/, which returns a 404. Invitation links and theAUTHENTIK_HOSTshown for outposts pointed at the server root. The map tiles and the about dialog background returned 404.The outpost side of the issue is fixed in #27290.
How was this tested?
Added unit tests for both helpers at the root and under a web path.
I ran the
gh-maindev images behind nginx, which only sends/authentik/to authentik, with a standalone RAC outpost built from #27290 and an SSH server, and drove Chromium:/ws/rac/<token>/, every attempt closed without data and the client stayed in "Waiting". With this change it opened/authentik/ws/rac/<token>/and the SSH prompt rendered. The notifications websocket connected at/authentik/ws/client/./if/flow/default-authentication-flow/(404), the outpost page showedAUTHENTIK_HOSTashttp://127.0.0.1:18803, and the map archive and the about dialog background returned 404. With this change, Execute opened/authentik/if/flow/default-authentication-flow/, the outpost page showedhttp://127.0.0.1:18803/authentik/, and the map archive, its glyphs and the background all loaded. The events map is enterprise-only, so I mounted<ak-map>on the page directly.I didn't check the invitation link or the email preview in the browser.
The change conflicts with
version-2026.8, so it needs a manual backport.Linked issues
Closes #26803
Checklist
make all)make docs)