Skip to content

Add allowPrivateIP to MCPExternalAuthConfig upstream provider configs #4523

Closed

Description

@amirejaz

Summary

The embedded auth server performs private IP checks when connecting to upstream OIDC/OAuth2 providers. Currently there is no per-provider flag to allow private IPs, unlike MCPServer.spec.oidcConfig which has jwksAllowPrivateIP and protectedResourceAllowPrivateIP.

Users running local IDPs (e.g. Kanidm, Keycloak) on private/RFC1918 addresses in lab/homelab environments are blocked with no scoped workaround.

Current behavior

OIDCUpstreamConfig and OAuth2UpstreamConfig in MCPExternalAuthConfig do not expose an allowPrivateIP field. The only workaround is setting INSECURE_DISABLE_URL_VALIDATION=true on the pod, which globally disables all URL validation (private IPs + HTTPS checks).

Expected behavior

Add an allowPrivateIP field to OIDCUpstreamConfig and OAuth2UpstreamConfig so users can opt in to private IP connections on a per-provider basis, without disabling all URL validation globally.

Precedent

The pattern already exists in the codebase:

  • MCPServer.spec.oidcConfig.jwksAllowPrivateIP
  • MCPServer.spec.oidcConfig.protectedResourceAllowPrivateIP

This is a straightforward extension of the same pattern to upstream provider configs.

Impact

  • Affects users using the embedded auth server with local/private IDPs
  • INSECURE_DISABLE_URL_VALIDATION=true is the only current option, which is too broad for production-adjacent environments

Activity

  1. added
    enhancement
    on Apr 3, 2026
  2. added
    go
    kubernetes
    on Apr 3, 2026
  3. tgrunnagle commented on Jun 24, 2026

    @tgrunnagle
    Collaborator

    Closed by #5618

  4. alex-feel commented on Aug 12, 2026

    @alex-feel
    Contributor

    This was closed as resolved by #5618, but #5618 implemented only the authserver-side half (it formally closes #5614): its changed files are pkg/authserver/config.go, pkg/authserver/upstream/{oauth2,oidc}.go, pkg/authserver/runner/embeddedauthserver.go, and the regenerated docs/server/* — nothing under cmd/thv-operator/. The CRD-level ask of this issue was never implemented and still reproduces on v0.42.1 and current main: OIDCUpstreamConfig/OAuth2UpstreamConfig carry no private-IP field, the controllerutil builders never set AllowPrivateIPs, and grep -rn AllowPrivateIPs cmd/thv-operator/ returns nothing at either version.

    Observed effect on an operator-deployed gateway federating a self-hosted IdP that resolves to a private address — the AS exits fail-closed at OIDC discovery and the proxy pod crash-loops:

    failed to create embedded auth server: ... failed to create upstream provider "idp":
    failed to discover OIDC endpoints: Get "https://idp.internal.example/.well-known/openid-configuration":
    dial tcp 10.0.0.5:443: the provided URL redirects to a private IP address, which is not allowed
    

    type: oauth2 with explicit endpoints is not a workaround: the same host-scoped HTTP client gates the token exchange, so the failure just moves from startup to the first sign-in. Since #5618, everything below the operator already handles allow_private_ips end to end, so the operator layer is the only missing link.

    Could this be reopened? I've opened #6288 wiring the field through the CRD (an allowPrivateIP opt-in on both upstream config types, following the jwksAllowPrivateIP naming precedent — the same shape #5784 discusses for remoteUrl).

  5. added 2 commits that reference this issue on Aug 16, 2026
    5c70f27
    9f8ffe6
  6. added a commit that references this issue on Aug 27, 2026
    7a54ea0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    authenticationauthorizationenhancementgokubernetesoperator

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions