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)
| 146 | // Extensions: |
| 147 | // x-ory-ratelimit-bucket: hydra-public-high |
| 148 | func (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 | |
| 162 | func (h *Handler) CreateClient(r *http.Request, validator func(context.Context, *Client) error, isDynamic bool) (*Client, error) { |
| 163 | var c Client |
nothing calls this directly
no test coverage detected