From 95f7aa2869f55cf6fa41f6bada8bd1944b2b63d2 Mon Sep 17 00:00:00 2001 From: Yanhu007 Date: Mon, 13 Apr 2026 02:06:12 +0800 Subject: [PATCH] fix(oidc): return registration_client_uri in PUT and GET dynamic client responses The OIDC Dynamic Client Registration PUT and GET endpoints do not include registration_client_uri in their responses, violating the OpenID Connect Dynamic Client Registration 1.0 specification. The POST (create) endpoint correctly sets RegistrationClientURI, but the PUT (update) and GET (read) endpoints omit it. Set RegistrationClientURI before writing the response in both setOidcDynamicClient and getOidcDynamicClient, matching the create handler's behavior. Fixes #4084 --- client/handler.go | 3 +++ 1 file changed, 3 insertions(+) diff --git a/client/handler.go b/client/handler.go index 79e55beb15..ccbe9e54d0 100644 --- a/client/handler.go +++ b/client/handler.go @@ -384,6 +384,8 @@ func (h *Handler) setOidcDynamicClient(w http.ResponseWriter, r *http.Request) { return } + c.RegistrationClientURI = urlx.AppendPaths(h.r.Config().PublicURL(r.Context()), DynClientsHandlerPath, url.PathEscape(c.GetID())).String() + h.r.Writer().Write(w, r, &c) } @@ -666,6 +668,7 @@ func (h *Handler) getOidcDynamicClient(w http.ResponseWriter, r *http.Request) { c.Secret = "" c.Metadata = nil + c.RegistrationClientURI = urlx.AppendPaths(h.r.Config().PublicURL(r.Context()), DynClientsHandlerPath, url.PathEscape(c.GetID())).String() h.r.Writer().Write(w, r, c) }