Repository navigation
fix(auth): OIDC login-loop hardening — interactive fallback on login_required, preserve pending logins (2.0) - #31182
mohityadav766 wants to merge 2 commits into
Conversation
… pending logins (#30304) - /callback with login_required/interaction_required/consent_required/ account_selection_required: redirect to interactive /signin instead of 500. These are the IdP's spec-defined 'silent auth not possible' replies (e.g. prompt=none with no IdP session); a 500 loops the frontend. - /callback with no pending session (stale/consumed cookie): redirect to /signin instead of 500 — the stale cookie is already cleared. - acquireRefreshLease on a PENDING (in-flight) login: return empty (401) WITHOUT clearing the session cookie — a concurrent tab's refresh timer must not break the login round-trip at the IdP. Root cause reproduced end-to-end on 1.13.1 + mock OIDC provider (issue #30304, Okta confidential + offline_access): login -> concurrent refresh -> user completes Okta -> callback fails -> loop. Test added for the pending-lease race. Co-Authored-By: Claude Opus 4.8 <[email protected]>
❌ PR checklist incompleteThis PR cannot be merged until the following are addressed on its linked issue:
The fields live on the linked issue in the Shipping project (open the issue → right sidebar → Projects). After you set them, re-run this check (or push a commit) — issue/project changes do not re-trigger it automatically. Maintainers can bypass this check by adding the |
✅ Playwright Results — workflow succeededValidated commit ✅ 796 passed · ❌ 0 failed · 🟡 0 flaky · ⏭️ 0 skipped · 🧰 0 lifecycle flaky PerformanceBlocking targets: ✅ met · Optimization targets: 🟡 in progress Shard-job maxima below are not the full workflow wall time; the linked run includes build, fixture, planning, and reporting. 🕒 Full workflow signal wall (to summary) 48m 59s ⏱️ Max setup 3m 2s · max shard execution 17m 15s · max shard-job elapsed before upload 20m 16s · reporting 5s 🌐 209.87 requests/attempt · 2.66 app boots/UI scenario · 14.30% common-shard skew Optimization targets still in progress:
How to debug locally# Download playwright-test-results-<shard> artifact and unzip
npx playwright show-trace path/to/trace.zip # view trace |
…auth fallback - handleCallback with no pending session now asserts the /signin redirect (was asserting the old 500), matching the login-loop fix - add regression tests: login_required at callback redirects to /signin, non-silent errors still 500 - log silent-auth errors at WARN instead of ERROR (expected path) Co-Authored-By: Claude Fable 5 <[email protected]>
|
closing will pick from main |
Code Review ✅ Approved 2 resolved / 2 findingsHardens OIDC authentication by adding interactive sign-in redirects for silent-auth errors and preserving pending logins during refresh lease acquisition, addressing both missing test coverage and outdated callback tests. ✅ 2 resolved✅ Bug: Existing callback test not updated for new redirect behavior
✅ Bug: No test coverage for SILENT_AUTH_ERRORS interactive fallback
OptionsDisplay: compact → Showing less information. Comment with these commands to change the behavior for this request:
Was this helpful? React with 👍 / 👎 | Powered by Gitar — free for open source |
Cherry-pick of #31181 onto 2.0 (files are identical between main and 2.0). Part of #30304.
handleCallback:login_required/interaction_required/consent_required/account_selection_required→ 302/signininstead of 500.handleCallback: missing pending session (stale cookie) → 302/signininstead of 500.SessionService.acquireRefreshLease: PENDING (in-flight) login → 401 without clearing the session cookie, so a concurrent tab's refresh no longer breaks the login round-trip at the IdP.Includes the regression test
acquireRefreshLease_pendingLogin_returnsEmptyWithoutClearingCookieOrSession(SessionServiceTest 32/32 green on main).Sibling PRs: main #31181, plus the 1.13 hotfix for the in-memory HttpSession architecture.
🤖 Generated with Claude Code