DeleteOAuth2ClientConfiguration deletes client registration (RFC 7592)
(ctx context.Context, clientID string, registrationAccessToken string)
| 609 | |
| 610 | // DeleteOAuth2ClientConfiguration deletes client registration (RFC 7592) |
| 611 | func (c *Client) DeleteOAuth2ClientConfiguration(ctx context.Context, clientID string, registrationAccessToken string) error { |
| 612 | res, err := c.Request(ctx, http.MethodDelete, fmt.Sprintf("/oauth2/clients/%s", clientID), nil, |
| 613 | func(r *http.Request) { |
| 614 | r.Header.Set("Authorization", "Bearer "+registrationAccessToken) |
| 615 | }) |
| 616 | if err != nil { |
| 617 | return err |
| 618 | } |
| 619 | defer res.Body.Close() |
| 620 | if res.StatusCode != http.StatusNoContent { |
| 621 | return ReadBodyAsError(res) |
| 622 | } |
| 623 | return nil |
| 624 | } |
| 625 | |
| 626 | // OAuth2ClientConfiguration represents RFC 7592 Client Read Response. |
| 627 | type OAuth2ClientConfiguration struct { |