Commit c546c11
fix(iam): revoke the single-use sso_state cookie on error paths
Both `delete_cookie` calls in the SSO callback sat in front of a `raise`, so
neither ever reached the client. The consequence is smaller than the refresh
one but real: once the state check passes, the state is meant to be spent,
and a failing code exchange left it replayable for the rest of its 10-minute
window.
Route them through `revoke_cookie` so the deletion survives the raise.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>1 parent b0e6759 commit c546c11
2 files changed
Lines changed: 22 additions & 2 deletions
File tree
- server
- src/identity_access_management_context/adapters/primary/fastapi/routes/sso
- tests/e2e
Lines changed: 9 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
| 28 | + | |
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
34 | 39 | | |
35 | 40 | | |
36 | 41 | | |
| |||
87 | 92 | | |
88 | 93 | | |
89 | 94 | | |
90 | | - | |
| 95 | + | |
91 | 96 | | |
92 | | - | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
93 | 100 | | |
94 | 101 | | |
95 | 102 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
130 | 130 | | |
131 | 131 | | |
132 | 132 | | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
0 commit comments