Commit 7bff13c
committed
fix: validate PRM resource match and handle DCR failure with pre-registered credentials
Two conformance auth scenario fixes:
1. Resource mismatch validation (RFC 8707): After discovering Protected
Resource Metadata, validate that the resource field matches the
server URL before proceeding with authorization. If the PRM returns
a resource from a different origin, raise OAuthFlowError.
2. Pre-registration fallback: When Dynamic Client Registration fails
(e.g. server returns 404), fall back to pre-registered client
credentials from storage instead of crashing. The conformance
client now pre-loads client credentials from MCP_CONFORMANCE_CONTEXT
when available.1 parent d3133ae commit 7bff13c
2 files changed
+46
-5
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
275 | 275 | | |
276 | 276 | | |
277 | 277 | | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
278 | 299 | | |
279 | 300 | | |
280 | 301 | | |
| |||
284 | 305 | | |
285 | 306 | | |
286 | 307 | | |
287 | | - | |
| 308 | + | |
288 | 309 | | |
289 | 310 | | |
290 | 311 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
476 | 476 | | |
477 | 477 | | |
478 | 478 | | |
| 479 | + | |
| 480 | + | |
| 481 | + | |
| 482 | + | |
| 483 | + | |
| 484 | + | |
| 485 | + | |
| 486 | + | |
| 487 | + | |
479 | 488 | | |
480 | 489 | | |
481 | 490 | | |
| |||
517 | 526 | | |
518 | 527 | | |
519 | 528 | | |
| 529 | + | |
| 530 | + | |
520 | 531 | | |
521 | 532 | | |
522 | 533 | | |
| |||
575 | 586 | | |
576 | 587 | | |
577 | 588 | | |
578 | | - | |
579 | | - | |
580 | | - | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
581 | 601 | | |
582 | 602 | | |
583 | 603 | | |
| |||
0 commit comments