Refuse an unbound or replayed state with a page back to the app, and keep use records through the skew
Browsers (Accept: text/html) refused for state_not_bound, state_already_launched or state_already_used get the handoff page linking to return_to, re-checked against the app's allowed origins; other callers keep the JSON code. A callback with no binding denies the attempt its signed state names (pending only). The memory store prunes a use record at exp + 30 s, as the state itself is accepted that long; the schema comment says the same. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
b541e094eb
commit
f1ddc2fffc
5 changed files with 182 additions and 25 deletions
|
|
@ -138,9 +138,9 @@ CREATE UNIQUE INDEX IF NOT EXISTS auth_completions_attempt_unconsumed_unique_idx
|
|||
|
||||
-- One use per (state jti, phase): a signed OAuth state launches once and
|
||||
-- completes once. The first INSERT for a pair wins; ON CONFLICT DO NOTHING
|
||||
-- reports every later claim as no row. The store deletes nothing, so rows stay
|
||||
-- like consumed auth_completions; after expires_at a state is refused before
|
||||
-- any claim, so a row is never consulted again.
|
||||
-- reports every later claim as no row. The Postgres store deletes nothing, so rows
|
||||
-- stay like consumed auth_completions; a state is accepted until expires_at + 30 s
|
||||
-- of skew, so a row may be pruned only after that and is never consulted again.
|
||||
CREATE TABLE IF NOT EXISTS oauth_state_uses (
|
||||
jti TEXT NOT NULL,
|
||||
phase TEXT NOT NULL,
|
||||
|
|
|
|||
Loading…
Reference in a new issue