@@ -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
@@ -744,6 +744,35 @@ standard `name` field.
744744
745745:: :
746746
747+ # ## Callback URL for upstream providers
748+
749+ When users authenticate through an upstream OIDC or OAuth 2.0 provider, the
750+ provider redirects them back to ToolHive's embedded authorization server after
751+ they consent. You must register this callback URL in your upstream provider's
752+ application settings.
753+
754+ The callback URL defaults to `{resourceUrl}/oauth/callback`, where
755+ ` {resourceUrl}` is the resource URL of the MCPServer or VirtualMCPServer using
756+ this `MCPExternalAuthConfig`. For example, if your server's resource URL is
757+ ` https://mcp.example.com/mcp` , the callback URL is
758+ ` https://mcp.example.com/mcp/oauth/callback` .
759+
760+ To override the default, set `redirectUri` explicitly on the `oidcConfig` or
761+ `oauth2Config` of each upstream provider :
762+
763+ ` ` ` yaml title="Explicit redirectUri"
764+ upstreamProviders:
765+ - name: google
766+ type: oidc
767+ oidcConfig:
768+ issuerUrl: 'https://accounts.google.com'
769+ clientId: '<YOUR_GOOGLE_CLIENT_ID>'
770+ redirectUri: 'https://mcp.example.com/mcp/oauth/callback'
771+ clientSecretRef:
772+ name: upstream-idp-secret
773+ key: client-secret
774+ ` ` `
775+
747776# ## Upstream-specific authorization parameters
748777
749778Some identity providers require custom query parameters on the authorization URL
@@ -836,7 +865,7 @@ kubectl apply -f authz-configmap.yaml
836865Add the authorization configuration to your `MCPServer` resources :
837866
838867` ` ` yaml title="mcp-server-with-authz.yaml"
839- apiVersion: toolhive.stacklok.dev/v1alpha1
868+ apiVersion: toolhive.stacklok.dev/v1beta1
840869kind: MCPOIDCConfig
841870metadata:
842871 name: k8s-sa-authz-oidc
@@ -847,7 +876,7 @@ spec:
847876 serviceAccount: 'mcp-client'
848877 namespace: 'client-apps'
849878---
850- apiVersion: toolhive.stacklok.dev/v1alpha1
879+ apiVersion: toolhive.stacklok.dev/v1beta1
851880kind: MCPServer
852881metadata:
853882 name: weather-server-with-authz
0 commit comments