【问题标题】:Google Calendar API request is denied for scope https://www.googleapis.com/auth/calendar.app.created范围 https://www.googleapis.com/auth/calendar.app.created 的 Google 日历 API 请求被拒绝
【发布时间】:2021-02-05 00:35:17
【问题描述】:

我的应用需要为用户创建一个 Google 日历并在其中管理活动。 Google API 控制台允许为此范围创建同意书:

https://www.googleapis.com/auth/calendar.app.created

它应该允许在这些日历中创建辅助日历和事件。描述如下:

制作辅助 Google 日历,并查看、创建、更改和删除 他们身上的事件

但是,在用户通过同意书等授予权限后,当我尝试创建日历时,我得到了 PERMISSION_DENIED(我使用的是 REST api https://www.googleapis.com/calendar/v3/calendars

{
  "error": {
    "code": 403,
    "message": "Request had insufficient authentication scopes.",
    "errors": [
      {
        "message": "Insufficient Permission",
        "domain": "global",
        "reason": "insufficientPermissions"
      }
    ],
    "status": "PERMISSION_DENIED"
  }
}

我的代码和其他管道(授权代码、访问令牌等)可以正常工作,因为如果我使用这个范围:

https://www.googleapis.com/auth/calendar

我可以创建日历。

那么,有人知道https://www.googleapis.com/auth/calendar.app.created 是否已被弃用吗?它没有在 V3 日历文档中列出,但我希望它继续工作。我不想让用户获得对所有日历的完全权限,因为我只想创建和访问辅助日历,而该范围应该完全符合我的需要。

想法?

【问题讨论】:

    标签: google-api calendar google-oauth google-calendar-api


    【解决方案1】:

    结论

    很遗憾,https://www.googleapis.com/auth/calendar.app.created 不是有效范围,OAuth2 playground 上接受此范围是一个错误。

    【讨论】:

      猜你喜欢
      • 2018-09-13
      • 1970-01-01
      • 2022-06-16
      • 2012-08-12
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-10
      • 2019-06-27
      相关资源
      最近更新 更多