我的应用程序需要创建一个 Google 日历并为用户管理其中的事件。 Google API Console 允许为此范围创建同意书:
https://www.googleapis.com/auth/calendar.app.created
它应该允许在这些日历中创建辅助日历和事件。说明如下:
Make secondary Google calendars, and see, create, change, and delete events on them
但是,在用户通过同意书等给予许可后,我在尝试创建日历时收到 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"
}
}
我的代码和其余的管道(授权代码、访问 token 等)工作,因为如果我使用这个范围:https://www.googleapis.com/auth/calendar
我能够创建日历。
所以,有人知道 https://www.googleapis.com/auth/calendar.app.created已弃用还是什么?它没有列在 V3 日历文档中,但我希望它继续工作。我不想要求用户获得对所有日历的完全许可,因为我只想创建和访问辅助日历,并且该范围应该完全满足我的需要。
想法?
最佳答案
结论
不幸的是https://www.googleapis.com/auth/calendar.app.created不是有效范围,在 OAuth2 playground 上接受此范围是一个错误。
关于google-api - 范围 https ://www. googleapis.com/auth/calendar.app.created 的 Google Calendar API 请求被拒绝,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/64474688/