Skip to content

web: keep the web path in URLs the interfaces build - #27291

Merged
dominic-r merged 2 commits into
mainfrom
dominic/web-path-urls
Oct 29, 2026
Merged

dominic-r merged 2 commits into
mainfrom
dominic/web-path-urls

Conversation

@dominic-r

Copy link
Copy Markdown
Member

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:

  • The RAC tunnel websocket (ws/rac/<token>/) goes through a new websocketURL helper, which the notifications websocket now uses too.
  • The "Execute" buttons on the flow list and flow page use toFlowInterface.
  • The invitation link.
  • AUTHENTIK_HOST in the outpost deployment info. AUTHENTIK_HOST_BROWSER stays the origin, because outposts only take its scheme and host.
  • The bundled map archive and glyphs, the about dialog background and the logo in email previews go through a staticURL helper that mirrors the server's StaticBackend.file_url.

DefaultBrand and BrandForm keep 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 the AUTHENTIK_HOST shown 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-main dev images behind nginx, which only sends /authentik/ to authentik, with a standalone RAC outpost built from #27290 and an SSH server, and drove Chromium:

  • With the stock web build, the RAC page opened /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/.
  • With the stock web build, Execute opened /if/flow/default-authentication-flow/ (404), the outpost page showed AUTHENTIK_HOST as http://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 showed http://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.
  • Without a web path, RAC, the notifications websocket, Execute, the map and the about dialog still worked.

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

  • The project has been linted, built, and tested (make all)
  • The documentation has been updated and formatted (make docs)
  • I have read the AI usage policy.

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
@dominic-r dominic-r added area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 labels Oct 27, 2026
@dominic-r
dominic-r requested a review from a team as a code owner October 27, 2026 23:37
@dominic-r dominic-r added area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8 labels Oct 27, 2026
@dominic-r dominic-r self-assigned this Oct 27, 2026
@netlify

netlify Bot commented Oct 27, 2026

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Name Link
🔨 Latest commit 0821646
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6ae135a6ac840c76511774d3
😎 Deploy Preview https://deploy-preview-27291--authentik-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov

codecov Bot commented Oct 27, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 92.48%. Comparing base (98c4b28) to head (8a7725e).
✅ All tests successful. No failed tests found.

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           
Flag Coverage Δ
conformance 31.14% <ø> (ø)
e2e 36.01% <ø> (+<0.01%) ⬆️
integration 28.62% <ø> (+<0.01%) ⬆️
rust 45.98% <ø> (ø)
unit 94.13% <ø> (+<0.01%) ⬆️
unit-migrate 94.12% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

@github-actions

github-actions Bot commented Oct 27, 2026 •

Copy link
Copy Markdown
Contributor

Playwright e2e

Download 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-report

Installation instructions

Instructions for docker-compose

Add the following block to your .env file:

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)s

Afterwards, run the upgrade commands from the latest release notes.

Instructions for Kubernetes

Add the following block to your values.yml file:

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-distroless

Afterwards, run the upgrade commands from the latest release notes.

@BeryJu BeryJu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably rebase after #27313

@dominic-r
dominic-r merged commit c8585f5 into main Oct 29, 2026
171 checks passed
@dominic-r
dominic-r deleted the dominic/web-path-urls branch October 29, 2026 15:23
@authentik-cherry-pick

Copy link
Copy Markdown
Contributor

⚠️ Cherry-pick to version-2026.8 has conflicts: #27346

GirlBossRush pushed a commit that referenced this pull request Nov 23, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #27291
Original commit: c8585f5
GirlBossRush pushed a commit that referenced this pull request Nov 28, 2026
This cherry-pick has conflicts that need manual resolution.

Original PR: #27291
Original commit: c8585f5
dominic-r added a commit that referenced this pull request Nov 28, 2026
… 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]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:frontend Features or issues related to the browser, TypeScript, Node.js, etc backport/version-2026.8 Add this label to PRs to backport changes to version-2026.8

Projects

None yet

Development

Successfully merging this pull request may close these issues.

RAC doesn’t work when authentik runs under a web path (AUTHENTIK_WEB__PATH)

2 participants