Repository navigation
web/flows: fix race condition in continuous login and support source stages in authentication flows - #23049
Merged
Conversation
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ 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 #23049 +/- ##
==========================================
- Coverage 93.28% 93.26% -0.03%
==========================================
Files 1037 1037
Lines 60556 60610 +54
Branches 400 400
==========================================
+ Hits 56490 56525 +35
- Misses 4066 4085 +19
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
2 tasks
✅ Deploy Preview for authentik-integrations ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
GirlBossRush
force-pushed
the
fix-continuous-login
branch
from
June 23, 2026 15:09
7bd8c94 to
64f7e09
Compare
Drop the unused isForeignURL() helper from RedirectStage (its only caller was replaced by the finalRedirect gate) and the write-only exitedTabIDs map from Broadcast (exit tracking now flows through AKMultiTabExitEvent).
The continuous-login branch of SAMLFlowFinalView built the
RedirectChallenge with data= and handed it straight to
HttpChallengeResponse, which reads .data. DRF raises AssertionError
("must call .is_valid()") when a serializer is given data= without
validation, so SP-initiated SAML Redirect-binding logins 500'd whenever
the flows_continuous_login flag was enabled. Use instance= to serialize
the value directly, matching the other RedirectChallenge call sites.
Add a regression test that drives the SP-initiated Redirect flow through
the executor to SAMLFlowFinalView under continuous login and asserts a
final redirect challenge is returned. Also fix the adjacent
resume-url test, which created a second Application for a provider that
already has one (violating the unique provider constraint).
GirlBossRush
approved these changes
Jun 23, 2026
Signed-off-by: Jens Langhammer <[email protected]>
BeryJu
approved these changes
Jun 26, 2026
GirlBossRush
added a commit
that referenced
this pull request
Jun 30, 2026
…stages in authentication flows (cherry-pick #23049 to version-2026.2) Backport of #23049, rebuilt from the final merged state on main (4296064) rather than the early PR revision the previous attempt was based on. Adaptations for version-2026.2: - FlowMultitabController logic ported inline into FlowExecutor's ak-multitab-continue listener (2026.2 lacks the controllers refactor), keeping the blank://blank app-hiding guard still used in 2026.2. - test_auth_n_request setUp creates the test-app Application (main already had it). - Generated API clients are produced from schema.yml at release time; only the schema contract is committed (2026.2 tracks no client-*). Co-Authored-By: Playpen Agent <[email protected]>
gergosimonyi
pushed a commit
that referenced
this pull request
Jul 3, 2026
…stages in authentication flows (cherry-pick #23049 to version-2026.2) (#23557) Backport of #23049, rebuilt from the final merged state on main (4296064) rather than the early PR revision the previous attempt was based on. Adaptations for version-2026.2: - FlowMultitabController logic ported inline into FlowExecutor's ak-multitab-continue listener (2026.2 lacks the controllers refactor), keeping the blank://blank app-hiding guard still used in 2026.2. - test_auth_n_request setUp creates the test-app Application (main already had it). - Generated API clients are produced from schema.yml at release time; only the schema contract is committed (2026.2 tracks no client-*). Co-authored-by: Playpen Agent <[email protected]>
GirlBossRush
added a commit
that referenced
this pull request
Jul 9, 2026
…stages in authentication flows (cherry-pick #23049 to version-2026.5) (#23558) Clean cherry-pick of #23049 (4296064) onto version-2026.5; no adaptations were needed. 2026.5 already has the flow controllers refactor, the blank://blank app-hiding migration, and the generated API clients tracked in-repo, so the squash diff applied verbatim. (cherry picked from commit 4296064) Co-authored-by: Ryan Pesek <[email protected]> Co-authored-by: Playpen Agent <[email protected]> Co-authored-by: Connor Peshek <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fix continuous login multi-tab coordination so tabs resume only after the authentication flow has fully completed, and preserve each tab’s original SP-initiated SAML request.
This also makes continuous login work correctly when the authentication flow contains intermediate source stages, such as an OIDC source step.
Details
This change fixes two related continuous-login issues:
The fix introduces an explicit final_redirect marker on redirect challenges. The frontend now only starts multi-tab resume orchestration when a redirect is known to be final. Intermediate redirects, including source-stage redirects, continue normally without resuming other tabs.
For SP-initiated SAML Redirect binding, the original SAML request URL is preserved as the flow next URL. This keeps each tab tied to its own SAMLRequest and RelayState when it resumes after another tab completes authentication.
The tab coordination logic was also hardened:
Behavior Changes
Testing
Checklist
make all)make docs)