Multi-account chooser (Tier 1, Phase 1): consent-surface remember + switch #3
Loading…
Reference in a new issue
No description provided.
Delete branch "feat/multi-account-chooser-phase1"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Multi-account chooser (Tier 1) — Phase 1
A "remembered accounts on this device" chooser, building on the issue #2 "Use a different account" affordance. Phase 1 covers the consent surface; the login-screen prefill (Phase 2) and the persistent page-chrome widget (Phase 3) are deliberately out of scope here.
Design
One live Kratos session at a time (Kratos is single-session-per-cookie), so switching is logout + a fresh login, not concurrent sessions. The remembered list is a signed
forseti_known_accountscookie holding identity UUIDs only; email and display name are resolved server-side and never written to a cookie or URL. The opt-in is captured server-side at consent (where the verified subject is already known), not via a login-screen checkbox, so there is no pre-auth flag that could persist the wrong identity.What's included
forseti_known_accountssigned cookie (MRU, deduped, capped at 5) and a dedicated TTL config key.ory::kratos::tear_down_sessionhelper; the OAuth logout and the issue #2 consent switch now share it.with_prompt_loginpreserves a client's existingprompt(only forcinglogin) and carries the target identity aslogin_hint.POST /accounts/switchwith a post-teardown verification gate: if the session is still live after teardown it aborts to/errorrather than redirecting (which would re-grant the old account). Clears the active-org pin only on success.POST /accounts/forget(one or all).Testing
prompt/login_hinthandling.login_hint— now a requiredidentity_id.tests/e2e/.../m-account-chooser.spec.ts): remember opt-in sets the cookie, the chooser lists the other account, and switching restarts the flow to a fresh login.Privacy
Consent is the lawful basis for the opt-in. The cookie holds only opaque identity UUIDs (no readable PII), client-side, with a TTL and an explicit forget path.
Relates to #2.