-
Notifications
You must be signed in to change notification settings - Fork 10
Add server OAuth protection conformance tests #64
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
@pcarleton do you even want something like this in the conformance repo, or should I go move some AS conformance testing towards the inspector. This PR is still a pretty basic auth scenario, and expanding the auth suite to handle bearer tokens will become increasingly painful with the current vitest infrastructure. So it might be best left elsewhere. Open to thoughts. |
commit: |
|
I'm open to it, I think it could be helpful. Originally, i was not going to test AS behavior, or at least not prioritize it because:
However, I think having the tests here would still be valuable if you're up for building it. Even if the SDK's don't provide it, it could be useful for testing an SDK + a chosen AS, so we have a "fully blessed" server example of the full suite. And it could be useful for a start to live server testing. I'd love to get an example going to see what the results look like. I have a branch where I've scooted the Typescript SDK to be on node-oidc-provider for its examples which might be useful here, since it should have all the things. If we like that approach, we could even give a way to spin up a conformant AS for servers and provide them the AS URL to check the AS <> SDK boundaries. |
|
next steps on this for me would be:
we've got some implicit best practices for scenarios starting to coalesce from writing a bunch for the spec release, which we can try to enumerate for this new batch. |
|
I've been using these new scenarios for the past few weeks and they're giving me a good signal on server auth conformance. Thanks @tobinsouth! These scenarios helped me realize that many public remote MCP servers already use the path insertion style of AS metadata URLs (from 2025-11-25). The only change I had to make was expanding the helper to support that style: tobinsouth#1 |
…auth-as-discovery Update metadata discovery in server auth scenraios for 2025-11-25
|
Amazing to hear @nbarbettini! Folded your PR in. I'm not actively maintaining this PR — there are some todo's like better unit testings and review to make sure we have coverage of the auth edge case weirdness. Might be worth revisiting and pulling into the repo if it's useful for auth vendors or folks doing specific SDK work on auth. |
Summary
Starting a discussion on adding OAuth conformance tests for servers behind an
--authflag. The scenarios are still somewhat basic and only tests resource server protection and metadata. This PR stops at the point where a bearer would need to be passed, only validating server OAuth infrastructure (discovery, metadata, HTTP responses) without requiring access tokens.In general, the concerns of the auth server are separated from the resource server, which puts auth conformance somewhat out of scope of SDKs. Having said that, it's a huge pain in the butt to achieve full auth conformance for Auth vendors, open-source auth solutions, or custom auth setups. This repo feels like a great place to put a reliable test of auth conformance testing for AS' wrapping servers against a high quality client.
Changes
New Test Scenarios (10 total)
server/auth-prm-discoveryserver/auth-as-metadata-discoveryserver/auth-discovery-mechanismserver/auth-as-pkce-supportserver/auth-as-cimd-supportedserver/auth-as-token-auth-methodsserver/auth-as-grant-typesserver/auth-prm-resource-validationserver/auth-401-unauthorizedserver/auth-www-authenticate-headerNew Files
CLI Options Added
Specifications Covered
There are more to cover here, but the rest will require handling bearer tokens robustly and likely interactive auth flows.
Test Plan
npm run typecheckpassesnpm run lintpassesnpm run buildpassesnpm testpasses (52 tests)