feat: add conformance tests for iss parameter (SEP-2468)#220
feat: add conformance tests for iss parameter (SEP-2468)#220max-stytch wants to merge 2 commits into
Conversation
Adds 5 draft conformance scenarios testing RFC 9207 issuer parameter validation in OAuth authorization responses: - auth/iss-supported: server advertises support and sends correct iss - auth/iss-not-advertised: server omits iss parameter entirely - auth/iss-supported-missing: client must reject missing iss when required - auth/iss-wrong-issuer: client must reject mismatched iss value - auth/iss-unexpected: client must reject iss when not advertised Also adds auth-test-iss-validation.ts, a reference client that correctly validates iss per RFC 9207, and negative tests confirming the standard client fails all three rejection scenarios. TODO: Update RFC_9207_ISS_PARAMETER spec reference once SEP-2468 (modelcontextprotocol/modelcontextprotocol#2468) is merged.
|
Conformance tests were ran against modelcontextprotocol/go-sdk#859 locally for verification purposes: |
| * includes the correct iss value in the authorization redirect. A conformant | ||
| * client should validate iss and proceed normally. | ||
| */ | ||
| export class IssParameterSupportedScenario implements Scenario { |
There was a problem hiding this comment.
I wanted to have one scenario with many checks, but it looks like the pattern is one scenario -> one auth server, and we need a separate AS for each check :/
| #!/usr/bin/env node | ||
|
|
||
| /** | ||
| * Well-behaved client that validates the iss parameter in authorization responses. |
There was a problem hiding this comment.
I would have loved to add this behavior to the base ConformanceOAuthProvider, but it looks like that provider doesn't have access to the AS Metadata currently, so it is not possible for us to do the checks there. runCrossAppAccessCompleteFlow similarly needs to fetch the metadata itself.
Defer to maintainers on how best to incorporate this code.
|
Thanks for this — I've opened max-stytch#1 stacked on top of this branch with review fixes (one commit per finding, take or leave each). Coverage table and the rebase-onto-main note are in that PR's body. Re |
Motivation and Context
Adds 5 draft conformance scenarios testing RFC 9207 issuer parameter validation in OAuth authorization responses:
Also adds auth-test-iss-validation.ts, a reference client that correctly validates iss per RFC 9207, and negative tests confirming the standard client fails all three rejection scenarios.
TODO: Update RFC_9207_ISS_PARAMETER spec reference once SEP-2468 (modelcontextprotocol/modelcontextprotocol#2468) is merged.
How Has This Been Tested?
CI/CD
Breaking Changes
Types of changes
Checklist
Additional context