Repository navigation
Conversation
✅ Deploy Preview for authentik-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
845f37b to
2fac33c
Compare
|
@APIUM Thanks for tracking this down and for the detailed write-up linking the WebKit bugs. I've pushed a few changes on this branch:
A wrong TOTP code can still log Could you try this on your iPhone setup and let me know how it goes? |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #25212 +/- ##
==========================================
- Coverage 92.69% 92.28% -0.41%
==========================================
Files 1198 1199 +1
Lines 81929 82091 +162
Branches 4686 4686
==========================================
- Hits 75945 75759 -186
- Misses 5908 6256 +348
Partials 76 76
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. |
2fac33c to
6431fa5
Compare
Thanks @GirlBossRush, I’ve been running this today and it’s working well for me so far. Will continue to use and let you know how I go. |
✅ Deploy Preview for authentik-storybook ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Some clients (iOS) send every flow-executor request twice. Processing both submissions uses the TOTP code twice: the duplicate fails as a replay, emits a login_failed event and can lock the user out. Fingerprint each submission by (session, stage binding, path, body) and select a single winner via an atomic cache.add; the duplicate waits for the winner's response and replays it. Every dedup path fails open to processing the request normally.
Replace cache polling with pglock.advisory. Store only redirects and carry their cookies, including the rotated session cookie, to the replay. Save the session before storing so a followed replay finds it.
Replace the mocked dedup tests with one customer path: a user whose TOTP code is submitted twice at once is logged in once, with no login_failed.
fc2039c to
59f15e7
Compare
|
This is still working well with my setup after about a week, no unexpected behavior. |
Details
What does this PR change?
FlowExecutorView.post()deduplicates identical concurrent submissions. Each submission is fingerprinted (by session, stage binding, path, body) - the first request to win an atomiccache.addprocesses the stage and stores its response for 5s, and a duplicate waits for that response and replays it.Why is this change needed?
iOS clients send every flow-executor request twice, concurrently (#25210). The duplicate consumes the TOTP code, so every successful iOS login emits a spurious
login_failed, and on slow links users get locked out of their own valid codes.How was this tested?
Six new unit tests in
authentik/flows/tests/test_executor_dedup.py; the fullauthentik/flows/testssuite passes (123) against postgres.I have also deployed it on my own instance and have been using it. iOS logins now don't fail, and I don get
login_failednotifications on them or the successful ones like I used to.Linked issues
closes #25210
Checklist
make all)The documentation has been updated and formatted (No docs changemake docs)