Skip to content

Commit 95f7aa2

Browse files
committed
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
1 parent f84c60a commit 95f7aa2

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

client/handler.go

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,8 @@ func (h *Handler) setOidcDynamicClient(w http.ResponseWriter, r *http.Request) {
384384
return
385385
}
386386

387+
c.RegistrationClientURI = urlx.AppendPaths(h.r.Config().PublicURL(r.Context()), DynClientsHandlerPath, url.PathEscape(c.GetID())).String()
388+
387389
h.r.Writer().Write(w, r, &c)
388390
}
389391

@@ -666,6 +668,7 @@ func (h *Handler) getOidcDynamicClient(w http.ResponseWriter, r *http.Request) {
666668

667669
c.Secret = ""
668670
c.Metadata = nil
671+
c.RegistrationClientURI = urlx.AppendPaths(h.r.Config().PublicURL(r.Context()), DynClientsHandlerPath, url.PathEscape(c.GetID())).String()
669672
h.r.Writer().Write(w, r, c)
670673
}
671674

0 commit comments

Comments
 (0)