RevokeOAuth2ProviderApp completely revokes an app's access for the authenticated user.
(ctx context.Context, appID uuid.UUID)
| 394 | // RevokeOAuth2ProviderApp completely revokes an app's access for the |
| 395 | // authenticated user. |
| 396 | func (c *Client) RevokeOAuth2ProviderApp(ctx context.Context, appID uuid.UUID) error { |
| 397 | res, err := c.Request(ctx, http.MethodDelete, "/oauth2/tokens", nil, func(r *http.Request) { |
| 398 | q := r.URL.Query() |
| 399 | q.Set("client_id", appID.String()) |
| 400 | r.URL.RawQuery = q.Encode() |
| 401 | }) |
| 402 | if err != nil { |
| 403 | return err |
| 404 | } |
| 405 | defer res.Body.Close() |
| 406 | if res.StatusCode != http.StatusNoContent { |
| 407 | return ReadBodyAsError(res) |
| 408 | } |
| 409 | return nil |
| 410 | } |
| 411 | |
| 412 | type OAuth2DeviceFlowCallbackResponse struct { |
| 413 | RedirectURL string `json:"redirect_url"` |