MCPcopy
hub / github.com/ory/hydra / createOidcDynamicClient

Method createOidcDynamicClient

client/handler.go:148–160  ·  view source on GitHub ↗

swagger:route POST /oauth2/register oidc createOidcDynamicClient # Register OAuth2 Client using OpenID Dynamic Client Registration This endpoint behaves like the administrative counterpart (`createOAuth2Client`) but is capable of facing the public internet directly and can be used in self-service.

(w http.ResponseWriter, r *http.Request)

Source from the content-addressed store, hash-verified

146// Extensions:
147// x-ory-ratelimit-bucket: hydra-public-high
148func (h *Handler) createOidcDynamicClient(w http.ResponseWriter, r *http.Request) {
149 if err := h.requireDynamicAuth(r); err != nil {
150 h.r.Writer().WriteError(w, r, err)
151 return
152 }
153 c, err := h.CreateClient(r, h.r.ClientValidator().ValidateDynamicRegistration, true)
154 if err != nil {
155 h.r.Writer().WriteError(w, r, errors.WithStack(err))
156 return
157 }
158
159 h.r.Writer().WriteCreated(w, r, urlx.MustJoin("admin", ClientsHandlerPath, url.PathEscape(c.GetID())), &c)
160}
161
162func (h *Handler) CreateClient(r *http.Request, validator func(context.Context, *Client) error, isDynamic bool) (*Client, error) {
163 var c Client

Callers

nothing calls this directly

Calls 5

requireDynamicAuthMethod · 0.95
CreateClientMethod · 0.95
WriterMethod · 0.65
ClientValidatorMethod · 0.65
GetIDMethod · 0.65

Tested by

no test coverage detected