@@ -107,7 +107,7 @@ isolation.
107107<TabItem value = " inline" label = " External IdP" default >
108108
109109``` yaml title="shared-oidc-config.yaml"
110- apiVersion : toolhive.stacklok.dev/v1alpha1
110+ apiVersion : toolhive.stacklok.dev/v1beta1
111111kind : MCPOIDCConfig
112112metadata :
113113 name : production-oidc
@@ -127,7 +127,7 @@ spec:
127127<TabItem value="k8s" label="Kubernetes service account">
128128
129129` ` ` yaml title="k8s-oidc-config.yaml"
130- apiVersion : toolhive.stacklok.dev/v1alpha1
130+ apiVersion : toolhive.stacklok.dev/v1beta1
131131kind : MCPOIDCConfig
132132metadata :
133133 name : k8s-sa-oidc
@@ -154,7 +154,7 @@ Use `oidcConfigRef` instead of inline `oidcConfig`. Each server must set a
154154unique ` audience ` to prevent token replay across servers:
155155
156156``` yaml title="mcp-server-shared-oidc.yaml"
157- apiVersion : toolhive.stacklok.dev/v1alpha1
157+ apiVersion : toolhive.stacklok.dev/v1beta1
158158kind : MCPServer
159159metadata :
160160 name : weather-server
@@ -217,7 +217,7 @@ settings, and an `MCPServer` resource that references it. The ToolHive proxy
217217handles authentication before forwarding requests to the MCP server.
218218
219219``` yaml title="mcp-server-external-auth.yaml"
220- apiVersion : toolhive.stacklok.dev/v1alpha1
220+ apiVersion : toolhive.stacklok.dev/v1beta1
221221kind : MCPOIDCConfig
222222metadata :
223223 name : external-oidc
@@ -229,7 +229,7 @@ spec:
229229 clientId : ' your-client-id'
230230 jwksUrl : ' https://your-oidc-issuer.com/path/to/jwks'
231231---
232- apiVersion : toolhive.stacklok.dev/v1alpha1
232+ apiVersion : toolhive.stacklok.dev/v1beta1
233233kind : MCPServer
234234metadata :
235235 name : weather-server-external
@@ -310,7 +310,7 @@ Create an `MCPOIDCConfig` resource for Kubernetes service account authentication
310310and an ` MCPServer ` that references it:
311311
312312``` yaml title="mcp-server-k8s-auth.yaml"
313- apiVersion : toolhive.stacklok.dev/v1alpha1
313+ apiVersion : toolhive.stacklok.dev/v1beta1
314314kind : MCPOIDCConfig
315315metadata :
316316 name : k8s-sa-oidc
@@ -321,7 +321,7 @@ spec:
321321 serviceAccount : ' mcp-client'
322322 namespace : ' client-apps'
323323---
324- apiVersion : toolhive.stacklok.dev/v1alpha1
324+ apiVersion : toolhive.stacklok.dev/v1beta1
325325kind : MCPServer
326326metadata :
327327 name : weather-server-k8s
@@ -499,7 +499,7 @@ Create an `MCPExternalAuthConfig` resource with the `embeddedAuthServer` type.
499499This example configures an OIDC upstream provider (the most common case) :
500500
501501` ` ` yaml title="embedded-auth-config.yaml"
502- apiVersion: toolhive.stacklok.dev/v1alpha1
502+ apiVersion: toolhive.stacklok.dev/v1beta1
503503kind: MCPExternalAuthConfig
504504metadata:
505505 name: embedded-auth-server
@@ -562,7 +562,7 @@ authorization server itself. The MCPOIDCConfig issuer must match the `issuer` in
562562your `MCPExternalAuthConfig`.
563563
564564` ` ` yaml title="mcp-server-embedded-auth.yaml"
565- apiVersion: toolhive.stacklok.dev/v1alpha1
565+ apiVersion: toolhive.stacklok.dev/v1beta1
566566kind: MCPOIDCConfig
567567metadata:
568568 name: embedded-auth-oidc
@@ -573,7 +573,7 @@ spec:
573573 # This must match the embedded authorization server issuer url
574574 issuer: 'https://mcp.example.com'
575575---
576- apiVersion: toolhive.stacklok.dev/v1alpha1
576+ apiVersion: toolhive.stacklok.dev/v1beta1
577577kind: MCPServer
578578metadata:
579579 name: weather-server-embedded
@@ -690,7 +690,7 @@ for providers like GitHub that use OAuth 2.0 but don't implement the full OIDC
690690specification.
691691
692692` ` ` yaml title="embedded-auth-oauth2-config.yaml"
693- apiVersion: toolhive.stacklok.dev/v1alpha1
693+ apiVersion: toolhive.stacklok.dev/v1beta1
694694kind: MCPExternalAuthConfig
695695metadata:
696696 name: embedded-auth-oauth2
@@ -788,6 +788,51 @@ refresh-token state), add `prompt: 'consent'` alongside `access_type: 'offline'`
788788- Google then shows the consent screen on every login and re-issues a refresh
789789 token each time.
790790
791+ # ## Default callback URL for upstream providers
792+
793+ When you omit `redirectUri` from an upstream provider's `oidcConfig` or
794+ ` oauth2Config` , the operator defaults it to `{resourceUrl}/oauth/callback`.
795+ ` resourceUrl` is the `oidcConfigRef.resourceUrl` set on the MCPServer or
796+ VirtualMCPServer that references this MCPExternalAuthConfig. It's typically the
797+ external URL that MCP clients use to reach the server.
798+
799+ You still need to register this callback URL with your upstream OAuth2 or OIDC
800+ provider before the flow can complete. Use the same URL on both sides : the value
801+ computed from `resourceUrl` here, and the authorized redirect URI in your
802+ provider's application settings.
803+
804+ For example, given this `oidcConfigRef` on an MCPServer :
805+
806+ ` ` ` yaml
807+ spec:
808+ oidcConfigRef:
809+ name: embedded-auth-oidc
810+ audience: 'https://mcp.example.com/mcp'
811+ resourceUrl: 'https://mcp.example.com/mcp'
812+ ` ` `
813+
814+ Omitting `redirectUri` on the upstream provider resolves the callback to
815+ `https://mcp.example.com/mcp/oauth/callback` :
816+
817+ ` ` ` yaml
818+ upstreamProviders:
819+ - name: google
820+ type: oidc
821+ oidcConfig:
822+ issuerUrl: 'https://accounts.google.com'
823+ clientId: '<YOUR_GOOGLE_CLIENT_ID>'
824+ clientSecretRef:
825+ name: upstream-idp-secret
826+ key: client-secret
827+ # redirectUri omitted - defaults to:
828+ # https://mcp.example.com/mcp/oauth/callback
829+ ` ` `
830+
831+ Set `redirectUri` explicitly if you need a non-default callback path, for
832+ example to route the callback through a separate gateway hostname. If
833+ ` resourceUrl` is also unset, no default is applied and the upstream provider
834+ must have `redirectUri` set explicitly.
835+
791836# # Set up authorization
792837
793838All authentication approaches can use the same authorization configuration using
@@ -836,7 +881,7 @@ kubectl apply -f authz-configmap.yaml
836881Add the authorization configuration to your `MCPServer` resources :
837882
838883` ` ` yaml title="mcp-server-with-authz.yaml"
839- apiVersion: toolhive.stacklok.dev/v1alpha1
884+ apiVersion: toolhive.stacklok.dev/v1beta1
840885kind: MCPOIDCConfig
841886metadata:
842887 name: k8s-sa-authz-oidc
@@ -847,7 +892,7 @@ spec:
847892 serviceAccount: 'mcp-client'
848893 namespace: 'client-apps'
849894---
850- apiVersion: toolhive.stacklok.dev/v1alpha1
895+ apiVersion: toolhive.stacklok.dev/v1beta1
851896kind: MCPServer
852897metadata:
853898 name: weather-server-with-authz
0 commit comments