Skip to content

fix(auth): support Authentik authorization URL override#12300

Merged
Steffen911 merged 6 commits intolangfuse:mainfrom
markwoodford:fix-authentik-redirect
Mar 2, 2026
Merged

fix(auth): support Authentik authorization URL override#12300
Steffen911 merged 6 commits intolangfuse:mainfrom
markwoodford:fix-authentik-redirect

Conversation

@markwoodford
Copy link
Contributor

@markwoodford markwoodford commented Feb 26, 2026

Fixes #11884

Summary

  • Add optional AUTH_AUTHENTIK_AUTHORIZATION_URL env var to allow browser redirects to use an external Authentik URL.
  • Keep issuer-based server-side validation while deriving token, userinfo, and JWKS endpoints from the issuer when override mode is enabled.
  • Relax AUTH_AUTHENTIK_ISSUER validation to allow an optional trailing slash.

Test plan

  • Configure AUTH_AUTHENTIK_ISSUER to an internal host and AUTH_AUTHENTIK_AUTHORIZATION_URL to a browser-reachable host.
  • Click Authentik login and verify redirect goes to the external authorization URL.
  • Complete login and verify token/userinfo/JWKS calls still work.
  • Verify existing Authentik setups without the new env var behave unchanged.

Made with Cursor


Important

Add support for overriding Authentik authorization URL via new env var, while maintaining server-side validation and relaxing issuer validation.

  • Behavior:
    • Add AUTH_AUTHENTIK_AUTHORIZATION_URL env var in env.mjs to override Authentik authorization URL for browser redirects.
    • Maintain server-side validation by deriving token, userinfo, and JWKS endpoints from issuer in auth.ts.
    • Relax AUTH_AUTHENTIK_ISSUER validation to allow optional trailing slash in env.mjs.
  • Implementation:
    • Modify auth.ts to handle new AUTH_AUTHENTIK_AUTHORIZATION_URL by setting custom authorization, token, userinfo, and JWKS URLs when override is enabled.
    • Update regex for AUTH_AUTHENTIK_ISSUER in env.mjs to allow optional trailing slash.

This description was created by Ellipsis for e27d963. You can customize this summary. It will automatically update as commits are pushed.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Feb 26, 2026
@CLAassistant
Copy link

CLAassistant commented Feb 26, 2026

CLA assistant check
All committers have signed the CLA.

@dosubot dosubot bot added the feat-auth label Feb 26, 2026
@Steffen911 Steffen911 self-requested a review February 27, 2026 08:15
Copy link
Member

@Steffen911 Steffen911 left a comment

Choose a reason for hiding this comment

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

Thank you a lot for creating this! 🙌

Steffen911 added a commit to langfuse/langfuse-docs that referenced this pull request Feb 27, 2026
Document the new `AUTH_AUTHENTIK_AUTHORIZATION_URL` env var for
split-DNS/reverse proxy setups and update the issuer format note
to reflect the now-optional trailing slash.

Ref: langfuse/langfuse#12300

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@Steffen911
Copy link
Member

Corresponding docs PR once this is merged: langfuse/langfuse-docs#2577

@Steffen911
Copy link
Member

Could you also address the linting reports?

@Steffen911 Steffen911 added this pull request to the merge queue Mar 2, 2026
@dosubot dosubot bot added the auto-merge This PR is set to be merged label Mar 2, 2026
Merged via the queue into langfuse:main with commit 6df18fe Mar 2, 2026
41 checks passed
@dosubot dosubot bot removed the auto-merge This PR is set to be merged label Mar 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feat-auth size:M This PR changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

bug: Authentik SSO redirects to internal issuer host

3 participants