Conversation
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.
Closes #57.
/mcpnow accepts end-user access tokens from the OIDC issuer already configured forbrowser login, through the existing
ExternalMcpBearerVerifierseam and the sameoidc:<issuer>plussubbinding. A token must name the configured issuer and carry<origin>/mcpinaud. ID tokens, tokens for another resource, and browser cookies arerefused. The server publishes RFC 9728 protected-resource metadata and answers an
unauthenticated call with
401andresource_metadata. Managed API keys and the WorkOSpath are untouched.
0028 records the reversal, 0020's exclusion points at it, MCP-013 takes the generic path,
and
docs/deployment.mdexplains the audience mapper and the two client-registrationoptions: the issuer's own RFC 7591 endpoint, or one client an administrator registers.
Artifact Server issues no client credentials, so MCP-014 stays as it is.
resolveIdentitynow also receives the credential. WorkOS ignores it. The OIDC pathneeds it, because userinfo answers the presenter of the token, and a Keycloak realm can
leave
emailout of the access token. The caching alternative is in 0028.Two calls for you
audmust contain<origin>/mcp, but a multi-valuedaudpasses. The Keycloak harnessin this PR mints this token from a client whose only extra configuration is the audience
mapper from the deployment guide:
{"aud": ["http://127.0.0.1:44835/mcp", "account"], "typ": "Bearer"}accountcomes from Keycloak's audience-resolve mapper, so a single-valued check wouldrefuse every Keycloak token. A token without this resource in
audis refused eitherway. Tell me if you meant single-valued and I will tighten it.
A valid token from a person who was never admitted gets
401at/mcp, while thebrowser callback answers
403for the same identity. I kept the existing mapping.Verification
pnpm lint,pnpm typecheck,pnpm build,pnpm conformance:validate,pnpm conformance:tests,pnpm test:oidcwith two new MCP cases against the pinnedKeycloak, and
pnpm testwith 320 passed. Threetests/cliprocess-spawning tests timeout under parallel load here and pass when run alone, the same way they do on an
unmodified checkout. I did not run the Compose, object-storage, Kubernetes, coverage, or
performance legs of
verify:iteration.Hostile cases in
tests/conformance/oidc-mcp-authorization.test.ts: expired, wrongissuer, a second issuer signing with the same key, wrong and multi-valued audiences, ID
token, HS256, unknown
kid, missing subject, missing claims, userinfo outage, userinforejection, key-set outage. That last case turned up a bug worth naming:
josereports anon-200 JWKS response as a generic error, which read as an invalid token and answered
401. The key-set fetch now raises its own failure.