Google+ scope PLUS.LOGIN 不要求 Google Circle Connection 许可

Google+ scope PLUS.LOGIN not asking for Google Circle Connection permission

我正在尝试获得 Google+ 可见的连接。 通过参考文档 https://developers.google.com/+/web/samples/php, 很明显,添加 'plus.login' 范围会获取 G+ 连接、年龄范围和语言。

但在我的例子中,这个范围只请求获取年龄范围和语言的许可。我无法获取 G+ 连接。

我尝试在我的应用程序中使用 google-api-php-client。也按照新申请中提到的快速入门指南进行操作,但访问权限页面不包括圈子权限中的 G+ 连接。

部分代码如下

    define('SCOPES', implode(' ',array(
    Google_Service_Plus::PLUS_ME, Google_Service_Plus::PLUS_LOGIN,Google_Service_Plus::USERINFO_EMAIL, Google_Service_People::CONTACTS 
            ))
        );

        Class GoogleClient {
            function getClient() {
                $client = new Google_Client();
                $client->setApplicationName(APPLICATION_NAME);
                $client->setScopes(SCOPES);
                $client->setAuthConfig(CLIENT_SECRET_PATH);
                $client->setAccessType('offline');

$this->authUrl = $client->createAuthUrl();

重定向到上面创建的 AuthUrl 会导致请求权限显示在图片中

$plusConnections = new \Google_Service_Plus($client);
            $optParamsConnections = ['maxResults' => 99];
            $_people              = $plusConnections->people->listPeople('me', 'visible', $optParamsConnections);

$_people 没有得到任何数据。然而,对于同一用户,当在 Google API 浏览器上尝试时,连接被检索

任何建议为什么会出现这种奇怪的行为以及如何解决它 谢谢

身份验证权限屏幕只是一个标准屏幕。它没有具体说明您可以访问哪些方法。在这种情况下,您应该查看文档

People.list

Authorization
This request requires authorization with at least one of the following scopes (read more about authentication and authorization).
Scope https://www.googleapis.com/auth/plus.login

只要您发送了 plus.login 范围并且用户接受了它,您就可以使用 people.list 方法。实际上,我认为“Basic profile info”就是您正在寻找的那个,它使您可以访问用户的许多一般 Google Plus 信息。

旁注:您应该尝试发送电子邮件范围或配置文件。如果是内存服务,它们都只是声明“offline Access”,IMO 对用户的误导更大。

plus.login 作用域检索连接的能力以及 People.list 端点本身已被弃用:

The Google+ People API list endpoint has been deprecated. In the past, the https://www.googleapis.com/auth/plus.login scope allowed access to a list of people in the user's circles in addition to their name and profile information. Starting in September 2016, new grants of the plus.login scope will allow access to only the user's name and profile info; calls to the API return empty circle data for those new sign-ins. In 2017 Q1, you will get empty circle data back for all users.

https://developers.google.com/+/web/people/#retrieve-a-collection-of-people