Repository navigation
PL-0506: RFC 9207 iss, invalid_grant re-sign-in, server audience - #114
Merged
Merged
Conversation
… audience - sign_in refuses an authorization answer whose iss differs from the issuer, and a missing iss when discovery advertises authorization_response_iss_parameter_supported - TokenSource drops the refresh token on invalid_grant (on_refresh sees None, the Warehouse page deletes the DPAPI copy, the next call is signin_required without an IdP call); other refresh errors keep it; resume deletes only on invalid_grant - Warehouse page "Server audience" setting (server.json server_audience) passed to sign_in only when set (Auth0); empty sends none (Keycloak scopes) - mock IdP tests for each item Co-Authored-By: Claude Opus 5.5 <[email protected]>
…l tests, resume delete under session lock - F1: RFC 9207 cases with an error answer (wrong iss; missing iss when advertised) - F2: an old token source's invalid_grant never deletes a newer saved sign-in - F3: resume takes a session snapshot and deletes on invalid_grant only under _session_lock while that session is still current; test included Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
PL-0506 desktop sign-in hardening (open items from M21 STATE lines). Mock IdP only; no real IdP/ERP calls. PL-0506 stays open (real IdP E3).
(a) RFC 9207 -
sign_inchecksissin the authorization answer before using it: when present it must equalendpoints.issuerexactly, otherwiseidp_issuer_mismatch;discoverreadsauthorization_response_iss_parameter_supported(only literaltrue), and then a missingissis refused too. The loopback receiver keeps blank values soiss=cannot slip through as "absent".(b) invalid_grant -
TokenSourceontoken_refused: invalid_grant(newINVALID_GRANT) drops the refresh token in memory and callson_refreshwithrefresh_token=None; the Warehouse page'skeep()then deletes the DPAPI file (same session lock/check as saves). The next call raisessignin_requiredwithout contacting the IdP (no loop); the existing status handling stops sync and asks to sign in again. Other errors (unreachable, 5xx) keep the token.resume_sign_innow deletes the saved sign-in only on invalid_grant (before: anytoken_refused/idp_discovery_failed, i.e. also a 503).(c) audience - new Warehouse field "Server audience" (
server.jsonkeyserver_audience), passed tosign_in(audience=...)only when set (Auth0-style IdPs, matching the server's--oidcaudience); empty sends no audience (Keycloak via client scopes). ERP keepsERP_AUDIENCE.Tests:
tests/core/test_desktop_signin.py(+6 parametrized RFC 9207 cases, +1 invalid_grant/503),tests/studio/test_warehouse_view.py(+audience, +refused refresh / 503 resume with DPAPI). Local: sign-in/secure-store/warehouse/oidc 62 passed; ruff, mypy (352 files), data guard PASS.🤖 Generated with Claude Code