CalendarList:列表需要不必要的敏感范围

问题描述 投票:0回答:1

我正在构建一个应用程序,要求用户从日历列表中选择他们的日历,然后我们检查繁忙的时段。我们不想访问日历内容,但 Google 似乎要求使用提升的范围来访问

https://www.googleapis.com/calendar/v3/users/me/calendarList

事实上,根据他们的doc,他们要求的最低范围是

https://www.googleapis.com/auth/calendar.readonly
,属于同意屏幕中的敏感范围类别,而
auth/calendar.calendarlist.readonly
应该足够了:

enter image description here

登录期间的同意摘要以了解更多详细信息:

enter image description here

我尝试在范围内使用

calendarlist.readonly
auth,但收到错误 403,如果我使用
calendar.readonly
,该错误就会消失。

有什么理由和希望改变吗?

google-calendar-api
1个回答
0
投票

如果您检查 calendarlist.list

的文档

您将看到使用此方法需要以下范围之一

enter image description here

这意味着您可以使用的最低级别范围是

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

如果您检查日历 API,v3 范围,您会注意到没有名为

https://www.googleapis.com/auth/calendarlist.readonly

的范围

如果您想使用该方法,您就没有选择,您必须使用

https://www.googleapis.com/auth/calendar.readonly
您无法发明自己的范围,我们受到谷歌提供的使用范围的限制。 说实话,驱动器更糟糕,我希望有一个范围,只能让我访问单个目录,但不能全部或全无。

© www.soinside.com 2019 - 2024. All rights reserved.