Merged
Conversation
jerm-dro
reviewed
Mar 12, 2026
Contributor
jerm-dro
left a comment
There was a problem hiding this comment.
My biggest concern is the incremental accumulation of more complexity in server.go that I'd like to find a way to better manage.
Otherwise this LGTM
This was referenced Mar 12, 2026
jerm-dro
approved these changes
Mar 13, 2026
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.
Related issue: https://github.com/stacklok/stacklok-epics/issues/251
Adds a new RFC proposing an optional embedded OAuth 2.0/OIDC authorization server inside the Virtual MCP Server (vMCP).
Why
vMCP today requires clients to arrive with a pre-obtained upstream IDP token. There is no mechanism for vMCP to orchestrate the auth flow itself — redirect clients through IDPs, collect their tokens, and issue a session-scoped ToolHive JWT. This RFC closes that gap.
Key Design Decisions
AuthServeris unset (Mode A). When set (Mode B), the embedded AS becomes the OIDC issuer; existing external-OIDC deployments are unaffected./.well-known/openid-configuration,/oauth/…) mount at the same origin as the vMCP HTTP server so the OIDC middleware's discovery call loops back to the embedded AS.identity.UpstreamTokensplumbing: After TH-JWT validation the OIDC middleware eagerly loads accumulated upstream tokens intoidentity.UpstreamTokens. Downstream outgoing auth strategies (deferred to follow-up RFC) consume from there.VirtualMCPServerSpecgainsAuthServerConfig *ExternalAuthConfigRef; the referencedMCPExternalAuthConfigmust be of typeembeddedAuthServer.ExternalAuthConfigRefis moved frommcpserver_types.gotomcpexternalauthconfig_types.go.allowedAudiencesby construction: Not a CRD field — the operator converter derives it fromIncomingAuth.OIDCConfig.Inline.Audience, preventing audience-mismatch misconfiguration.subandclaimsin the TH-JWT are sourced from the first upstream IDP inupstreamProviders. Operators should list the corporate IDP first when present.upstream_injectoutgoing auth strategy is explicitly out of scope; it will be specified in a follow-up RFC once theidentity.UpstreamTokensplumbing (this RFC) and multi-IDP support (RFC-0052) are in place.Depends On
identity.UpstreamTokenspopulation in the OIDC middleware)