Google Calendar API - Requesting multiple scopes puts checkbox in authorization request?

Viewed 103

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:

enter image description here

When I request both scopes:

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

enter image description here

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 Answers

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:

Related