google-apigoogle-plusgoogle-api-php-clientgoogle-plus-signingoogle-php-sdk

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


I am trying to get Google+ connections that are visible. by referring to documentation https://developers.google.com/+/web/samples/php, it is clear that on adding 'plus.login' scope fetches G+ connections, age range and language.

But in my case this scope only asks permission for fetching age range and language. I am not able to fetch G+ connections.

I tried using google-api-php-client in my application. Also followed the quick start guide as mentioned in fresh application but access permission page does not include G+ connection in circle permission.

part of the code is below

    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();

redirecting to the above created AuthUrl results in asking permissions displayed in picture

enter image description here

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

$_people doesnt get any data. however for the same user when tried on Google API explorer, the connections are retrived

any suggestion why is this strange behaviour and how to resolve it thanks


Solution

  • The ability of the plus.login scope to retrieve connections, and the People.list endpoint itself, has been deprecated:

    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