Skip to content

core: allow launch URLs relative to the current host - #27632

Merged
dominic-r merged 13 commits into
goauthentik:mainfrom
gedemagt:core/relative-launch-url
Nov 19, 2026
Merged

dominic-r merged 13 commits into
goauthentik:mainfrom
gedemagt:core/relative-launch-url

Conversation

@gedemagt

@gedemagt gedemagt commented Nov 5, 2026

Copy link
Copy Markdown
Contributor

Details

What does this PR change?

Allows Application.meta_launch_url to be a path relative to the current host, such as /myapp/.

  • DomainlessFormattedURLValidator now also accepts paths starting with a single /. Values starting with // or /\ are rejected, as browsers treat those as another host. The validator is extended in place, so no migration is needed.
  • The applications docs describe relative launch URLs and when they are useful.

Why is this change needed?

In internal networks (edge deployments, changing VPN hostnames), the hostname used to reach authentik can change more often than we want to redeploy. When an application is served on the same origin as authentik, for example behind the same reverse proxy, a launch URL relative to the current host keeps working regardless of which hostname the user came in on.

The frontend and docs already expect relative launch URLs, but the backend rejects them:

  • appHasLaunchUrl (web/src/user/LibraryPage/LibraryPageImpl.utils.ts) shows apps whose launch URL has no :// on the dashboard.
  • The applications docs say apps "that use relative paths" appear on the dashboard.
  • Setting one through the API or a blueprint fails with "Enter a valid URL."

All consumers of get_launch_url() already pass a relative path through to the browser: the /application/launch/<slug>/ redirect, RedirectChallenge.to, and application_launch_url in the flow info.

How was this tested?

  • New test_relative_launch_url: the API accepts /app/ and /app/%(username)s?a=b#c, and rejects //example.com/app/, /\example.com/app/, /app /, app/ and javascript:alert(1).
  • New test_check_redirect_auth_relative: the launch view redirects to the formatted relative path.
  • authentik/core/tests, authentik/blueprints/tests, authentik/lib/tests and authentik/flows/tests pass. The only failures also occur on unmodified main in my environment, or are order-dependent.
  • make ci-lint-pending-migrations reports no changes; black and ruff are clean.

Linked issues

Closes #27631

AI Usage

Claude Code has assisted me identifying the issue and proposing a fix as well as reviewing the code in terms our you contribution guidelines.


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.

@gedemagt
gedemagt requested review from a team as code owners November 5, 2026 09:12
@netlify

netlify Bot commented Nov 5, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for authentik-docs ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit d4b8c6b
🔍 Latest deploy log https://app.netlify.com/projects/authentik-docs/deploys/6afe5408fffea6928b2db69a
😎 Deploy Preview https://deploy-preview-27632--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.

@gedemagt

gedemagt commented Nov 9, 2026

Copy link
Copy Markdown
Contributor Author

Do we need more work on this one? 🙂

@codecov

codecov Bot commented Nov 18, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.09%. Comparing base (832cdf8) to head (c7db4a8).
⚠️ Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #27632      +/-   ##
==========================================
- Coverage   93.12%   93.09%   -0.03%     
==========================================
  Files        1238     1238              
  Lines       86901    86942      +41     
  Branches     4894     4894              
==========================================
+ Hits        80923    80938      +15     
- Misses       5891     5917      +26     
  Partials       87       87              
Flag Coverage Δ
conformance 30.24% <6.97%> (-0.02%) ⬇️
e2e 34.87% <11.62%> (-0.02%) ⬇️
integration 27.44% <6.97%> (-0.32%) ⬇️
rust 51.12% <ø> (ø)
unit 94.65% <100.00%> (+<0.01%) ⬆️
unit-migrate 94.66% <100.00%> (+<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.

@dominic-r
dominic-r requested a review from a team as a code owner November 19, 2026 01:58
@dominic-r
dominic-r merged commit a9a8064 into goauthentik:main Nov 19, 2026
164 checks passed
kensternberg-authentik added a commit that referenced this pull request Nov 19, 2026
* main:
  core: allow launch URLs relative to the current host (#27632)
  website/releases: 2026.11: benchmaxxing (#27796)
  core: bump goauthentik/fips-python from `72f6e14` to `8fd04de` in /lifecycle/container (#27920)
  root: require Node.js 24.22.3 (#27906)
  admin/files, core: read the cached icon URLs of a list in one query (#27695)
  core: bump pnpm to 12.22.0 everywhere (#27905)
  web/elements: fix the wizard next button staying disabled (#27660)
  events, tasks: speed up the event and task queries (#27692)
  core: bump the pnpm group across 2 directories with 1 update (#26843)
  core: bump astral-sh/uv from 0.13.8 to 0.13.9 in /lifecycle/container (#27893)
  core: bump aws-cdk-lib from 2.275.0 to 2.276.0 (#27899)
  core: bump jsonpatch from 1.44 to 1.46 (#27898)
  core: bump cachetools from 7.3.1 to 7.3.2 (#27897)
  core: bump google-api-python-client from 2.201.0 to 2.202.0 (#27896)
  core: bump goauthentik/fips-python from `96730cd` to `72f6e14` in /lifecycle/container (#27894)
  ci: bump taiki-e/install-action from 2.90.3 to 2.90.4 in /.github/actions/setup (#27895)
  core: bump goauthentik/fips-debian from `56dbb46` to `712d5d1` in /lifecycle/container (#27892)
  core: bump github.com/grafana/pyroscope-go from 1.4.3 to 1.5.0 (#27891)
  providers/saml: add option to ignore ForceAuthn from the SP (#27057)
  website/integrations: add Radarr (#27882)
kensternberg-authentik added a commit that referenced this pull request Nov 19, 2026
…enance-2

* web/spike/icon-identification: (21 commits)
  core: allow launch URLs relative to the current host (#27632)
  website/releases: 2026.11: benchmaxxing (#27796)
  core: bump goauthentik/fips-python from `72f6e14` to `8fd04de` in /lifecycle/container (#27920)
  root: require Node.js 24.22.3 (#27906)
  admin/files, core: read the cached icon URLs of a list in one query (#27695)
  core: bump pnpm to 12.22.0 everywhere (#27905)
  web/elements: fix the wizard next button staying disabled (#27660)
  events, tasks: speed up the event and task queries (#27692)
  core: bump the pnpm group across 2 directories with 1 update (#26843)
  core: bump astral-sh/uv from 0.13.8 to 0.13.9 in /lifecycle/container (#27893)
  core: bump aws-cdk-lib from 2.275.0 to 2.276.0 (#27899)
  core: bump jsonpatch from 1.44 to 1.46 (#27898)
  core: bump cachetools from 7.3.1 to 7.3.2 (#27897)
  core: bump google-api-python-client from 2.201.0 to 2.202.0 (#27896)
  core: bump goauthentik/fips-python from `96730cd` to `72f6e14` in /lifecycle/container (#27894)
  ci: bump taiki-e/install-action from 2.90.3 to 2.90.4 in /.github/actions/setup (#27895)
  core: bump goauthentik/fips-debian from `56dbb46` to `712d5d1` in /lifecycle/container (#27892)
  core: bump github.com/grafana/pyroscope-go from 1.4.3 to 1.5.0 (#27891)
  providers/saml: add option to ignore ForceAuthn from the SP (#27057)
  Reviewer's request: deleting yourself only deserves a warning.
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Allow root-relative paths in applications meta_launch_urls

5 participants