@@ -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,53 @@ 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+ Starting in v0.23.0, the `redirectUri` field on an upstream provider's
794+ ` oidcConfig` or `oauth2Config` is optional. When you omit it, the operator
795+ defaults it to `{resourceUrl}/oauth/callback`, where `resourceUrl` is the value
796+ from the MCPServer's `oidcConfigRef.resourceUrl` (the same URL the embedded
797+ authorization server advertises as its protected resource).
798+
799+ ` ` ` yaml title="Upstream provider with defaulted redirect URI"
800+ # Assumes the MCPServer references this config with:
801+ # oidcConfigRef:
802+ # resourceUrl: https://mcp.example.com/mcp
803+ #
804+ # With no redirectUri set, the operator uses
805+ # https://mcp.example.com/mcp/oauth/callback
806+ upstreamProviders:
807+ - name: google
808+ type: oidc
809+ oidcConfig:
810+ issuerUrl: 'https://accounts.google.com'
811+ clientId: '<YOUR_GOOGLE_CLIENT_ID>'
812+ clientSecretRef:
813+ name: upstream-idp-secret
814+ key: client-secret
815+ ` ` `
816+
817+ Set `redirectUri` explicitly if your upstream provider is registered with a
818+ different callback path, or if your MCPServer does not set `resourceUrl` (in
819+ which case no default is applied) :
820+
821+ ` ` ` yaml title="Upstream provider with explicit redirect URI"
822+ upstreamProviders:
823+ - name: google
824+ type: oidc
825+ oidcConfig:
826+ issuerUrl: 'https://accounts.google.com'
827+ clientId: '<YOUR_GOOGLE_CLIENT_ID>'
828+ # highlight-next-line
829+ redirectUri: 'https://mcp.example.com/custom/callback'
830+ clientSecretRef:
831+ name: upstream-idp-secret
832+ key: client-secret
833+ ` ` `
834+
835+ Whichever value ends up in effect - defaulted or explicit - must exactly match
836+ the redirect URI registered with the upstream identity provider.
837+
791838# # Set up authorization
792839
793840All authentication approaches can use the same authorization configuration using
@@ -836,7 +883,7 @@ kubectl apply -f authz-configmap.yaml
836883Add the authorization configuration to your `MCPServer` resources :
837884
838885` ` ` yaml title="mcp-server-with-authz.yaml"
839- apiVersion: toolhive.stacklok.dev/v1alpha1
886+ apiVersion: toolhive.stacklok.dev/v1beta1
840887kind: MCPOIDCConfig
841888metadata:
842889 name: k8s-sa-authz-oidc
@@ -847,7 +894,7 @@ spec:
847894 serviceAccount: 'mcp-client'
848895 namespace: 'client-apps'
849896---
850- apiVersion: toolhive.stacklok.dev/v1alpha1
897+ apiVersion: toolhive.stacklok.dev/v1beta1
851898kind: MCPServer
852899metadata:
853900 name: weather-server-with-authz
0 commit comments