fix routing of well known urlks for MCP registration

This commit is contained in:
Jonas Leder 2026-10-20 20:13:23 +02:00
commit 740adb1f5e
4 changed files with 18 additions and 1 deletions

View file

@ -178,7 +178,8 @@ server (streamable HTTP, stateless) at `/api/v1/mcp`. It is enabled whenever OID
`OIDC_REDIRECT_URL` callback is reused, so nothing else has to be registered there.
1. An unauthenticated request gets `401` with a pointer to `/api/v1/mcp-metadata` (RFC 9728), which
names this server (`/api/v1/oauth`) as authorization server (RFC 8414 metadata is served below
`/api/v1/oauth/.well-known/` and, if the ingress forwards it, at `/.well-known/`).
`/api/v1/oauth/.well-known/` and at `/.well-known/`; the Helm ingress forwards these via
`ingress.wellKnownPaths`).
2. The client registers itself at `/api/v1/oauth/register` and sends the user to
`/api/v1/oauth/authorize`. The user first confirms the client, then signs in at the OIDC provider.
Role and groups are mapped exactly like for a browser login (`OIDC_ADMIN_GROUPS`, `OIDC_USER_GROUPS`).

View file

@ -0,0 +1 @@
3

View file

@ -35,6 +35,15 @@ spec:
name: {{ $fullName }}-backend
port:
number: {{ .Values.backend.service.port }}
{{- range .Values.ingress.wellKnownPaths }}
- path: {{ . }}
pathType: {{ $.Values.ingress.pathType }}
backend:
service:
name: {{ $fullName }}-backend
port:
number: {{ $.Values.backend.service.port }}
{{- end }}
- path: {{ .Values.ingress.frontendPath }}
pathType: {{ .Values.ingress.pathType }}
backend:

View file

@ -33,6 +33,12 @@ ingress:
host: chart-example.local
frontendPath: /
apiPath: /api
# Root-level discovery documents for MCP OAuth clients (RFC 8414 / RFC 9728),
# served by the backend. Without them the SPA answers with index.html.
wellKnownPaths:
- /.well-known/oauth-authorization-server
- /.well-known/openid-configuration
- /.well-known/oauth-protected-resource
pathType: Prefix
tls: []