MCPcopy Index your code
hub / github.com/coder/coder / PostOAuth2ClientRegistration

Method PostOAuth2ClientRegistration

codersdk/oauth2.go:563–574  ·  view source on GitHub ↗

PostOAuth2ClientRegistration dynamically registers a new OAuth2 client (RFC 7591)

(ctx context.Context, req OAuth2ClientRegistrationRequest)

Source from the content-addressed store, hash-verified

561
562// PostOAuth2ClientRegistration dynamically registers a new OAuth2 client (RFC 7591)
563func (c *Client) PostOAuth2ClientRegistration(ctx context.Context, req OAuth2ClientRegistrationRequest) (OAuth2ClientRegistrationResponse, error) {
564 res, err := c.Request(ctx, http.MethodPost, "/oauth2/register", req)
565 if err != nil {
566 return OAuth2ClientRegistrationResponse{}, err
567 }
568 defer res.Body.Close()
569 if res.StatusCode != http.StatusCreated {
570 return OAuth2ClientRegistrationResponse{}, ReadBodyAsError(res)
571 }
572 var resp OAuth2ClientRegistrationResponse
573 return resp, json.NewDecoder(res.Body).Decode(&resp)
574}
575
576// GetOAuth2ClientConfiguration retrieves client configuration (RFC 7592)
577func (c *Client) GetOAuth2ClientConfiguration(ctx context.Context, clientID string, registrationAccessToken string) (OAuth2ClientConfiguration, error) {

Calls 3

RequestMethod · 0.95
ReadBodyAsErrorFunction · 0.85
CloseMethod · 0.65