Skip to content

Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime #4485

Closed

Description

@tgrunnagle

Summary

The VirtualMCPServer CRD supports jwksUrl and introspectionUrl on its OIDC config (via MCPOIDCConfig), and the operator's OIDC resolver correctly extracts them into oidc.OIDCConfig.JWKSURL and .IntrospectionURL. However, the converter that maps from oidc.OIDCConfig → vmcpconfig.OIDCConfig silently drops both fields because the vMCP runtime config struct doesn't define them.

On the MCPServer path these fields flow through correctly via runner.WithOIDCConfig(...) → auth.TokenValidatorConfig.JWKSURL / .IntrospectionURL. The vMCP path is missing the equivalent wiring.

Impact: vMCP always falls back to OIDC discovery to find the JWKS endpoint. This fails when the OIDC issuer doesn't serve a /.well-known/openid-configuration or when the user wants to override the JWKS/introspection URL explicitly.

Root cause

Three points in the chain are missing the fields:

Step File Issue
vMCP config model pkg/vmcp/config/config.go OIDCConfig struct No JwksUrl or IntrospectionUrl fields
CRD → vMCP converter cmd/thv-operator/pkg/vmcpconfig/converter.go mapResolvedOIDCToVmcpConfig() Does not map JWKSURL or IntrospectionURL from resolved config
vMCP auth factory pkg/vmcp/auth/factory/incoming.go newOIDCAuthMiddleware() Does not pass JWKS/introspection URL to auth.TokenValidatorConfig

Proposed fix

  1. Add fields to vmcpconfig.OIDCConfig (pkg/vmcp/config/config.go): add JwksUrl string and IntrospectionUrl string optional fields
  2. Regenerate deepcopy: task gen
  3. Wire in converter (cmd/thv-operator/pkg/vmcpconfig/converter.go): map resolved.JWKSURL → config.JwksUrl and resolved.IntrospectionURL → config.IntrospectionUrl
  4. Wire in auth factory (pkg/vmcp/auth/factory/incoming.go): pass oidcCfg.JwksUrl → JWKSURL and oidcCfg.IntrospectionUrl → IntrospectionURL on auth.TokenValidatorConfig
  5. Update tests: converter test (converter_test.go) and YAML loader test (yaml_loader_test.go)

Generated with Claude Code

Activity

  1. added
    bug
    on Apr 1, 2026
  2. self-assigned this
    on Apr 1, 2026
  3. added
    vmcp
    on Apr 1, 2026
  4. changed the title [-]Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime[/-] [+]bug: Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime[/+] on Apr 1, 2026
  5. changed the title [-]bug: Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime[/-] [+]Wire jwksUrl and introspectionUrl from vMCP inline OIDC config to runtime[/+] on Apr 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

authenticationbugoperatorvmcp

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions