Commit 095f189
committed
Make IdentityAssertionOAuthProvider a standalone httpx.Auth
The previous implementation inherited OAuthClientProvider.async_auth_flow,
whose trust model (RS chooses the AS via PRM, client DCRs there, AS-advertised
scopes win) is the inverse of SEP-990's (AS is enterprise configuration, RS is
untrusted for AS selection, client is pre-provisioned). Each inherited step was
neutralized by a guard, and successive review rounds kept finding paths around
them - PRM authorization_servers[0] overwriting the pin, the legacy ASM-from-RS
fallback, SEP-2352 clear-and-re-DCR, scope-selection overwrite.
This drops the inheritance. IdentityAssertionOAuthProvider is now a standalone
httpx.Auth: the AS issuer is a constructor argument, ASM is fetched from that
issuer's RFC 8414 well-known, validate_metadata_issuer and a same-origin
token_endpoint check run, and the jwt-bearer request goes only there. There is
no PRM fetch, no DCR step, no credentials_match_issuer step, and no mutable
client_metadata.scope - the resource server has no input into where the ID-JAG
or client secret are sent. This matches go-sdk and csharp-sdk, which take the
AS URL as configuration.
Also:
- ClientAuthenticator now rejects a secret-based auth method registered without
a stored secret (the gap the per-grant confidential gate was compensating for).
- JWT_BEARER_GRANT_TYPE is defined once in mcp.shared.auth and imported.
- expected_issuer renamed to issuer (it is the address, not a check); scopes
renamed to scope for consistency with the other extensions.
- Client tests rewritten around the new flow, including a by-construction test
asserting the RS is never consulted for AS selection.1 parent 6689e0a commit 095f189
13 files changed
Lines changed: 511 additions & 407 deletions
File tree
- docs
- examples/snippets/clients
- src/mcp
- client/auth/extensions
- server/auth
- handlers
- middleware
- tests
- client
- auth/extensions
- interaction
- auth
- server/auth
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1460 | 1460 | | |
1461 | 1461 | | |
1462 | 1462 | | |
1463 | | - | |
| 1463 | + | |
1464 | 1464 | | |
1465 | 1465 | | |
1466 | 1466 | | |
1467 | 1467 | | |
1468 | | - | |
| 1468 | + | |
1469 | 1469 | | |
1470 | 1470 | | |
1471 | 1471 | | |
1472 | | - | |
| 1472 | + | |
1473 | 1473 | | |
1474 | 1474 | | |
1475 | 1475 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
12 | | - | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
| |||
59 | 61 | | |
60 | 62 | | |
61 | 63 | | |
62 | | - | |
| 64 | + | |
63 | 65 | | |
64 | | - | |
| 66 | + | |
65 | 67 | | |
66 | 68 | | |
67 | 69 | | |
| |||
0 commit comments