我有一个带有OAuth2的Google日历API设置。
我只能要求日历范围,但是我想添加 userInfo.email
范围。当我使用 setScopes()
函数添加时,如下授权请求页面所在下面没有自动选中 calendar_events
范围的复选框:
仅要求 calendar_events 范围:
$client->setScopes([Google_Service_Calendar::CALENDAR_EVENTS]);
我得到这样的授权请求:
$client->setScopes([Google_Service_Calendar::CALENDAR_EVENTS, 'https://www.googleapis.com/auth/userinfo.email']);
“>
用户必须明确检查日历范围。大多数用户不会阅读并检查该范围。因此,我没有最重要的范围。
如何获得 calendar_events
范围在请求多个范围时自动检查? API已设置以允许该范围。
I have a Google Calendar API setup with Oauth2.
I can request only the calendar scope, but I want to add the userinfo.email
scope. When I add it using the setScopes()
function like below the authorization request page does not automatically check the checkbox for the CALENDAR_EVENTS
scope:
Only asking for CALENDAR_EVENTS
scope:
$client->setScopes([Google_Service_Calendar::CALENDAR_EVENTS]);
I get an authorization request like this:

When I request both scopes:
$client->setScopes([Google_Service_Calendar::CALENDAR_EVENTS, 'https://www.googleapis.com/auth/userinfo.email']);

The user must check the calendar scope explicitly. Most users will not read and check that scope. So, I don't get the most important scope.
How to I get the CALENDAR_EVENTS
scope to automatically check when requesting multiple scopes? The API is setup to allow that scope.
发布评论
评论(1)
这些复选框归因于Google的新颗粒帐户许可系统的推出。当应用要求从不同服务访问时,该行为会激活。您可以在博客在这里和开发人员博客在这里。
看来复选框完全正常,无法关闭。
参考:
These checkboxes are due to the rolling out of a new granular account permission system by Google. The behavior gets activated when the app is requesting access from different services. You can read more about this change in the blog here and the Developer blog here.
It seems that the checkboxes are completely normal, and can not be turned off.
Reference: