<?php require_once 'system/config.php'; require_once 'system/oauth2_google/Google_Client.php'; require_once 'system/oauth2_google/contrib/Google_PlusService.php'; $client = new Google_Client(); $client->setApplicationName("Google+ PHP Starter Application"); $plus = new Google_PlusService($client); } } $client->authenticate(); $_SESSION['token'] = $client->getAccessToken(); $redirect = 'http://' . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF']; } $client->setAccessToken($_SESSION['token']); } if ($client->getAccessToken()) { $me = $plus->people->get('me'); $activities = $plus->activities->listActivities('me', 'public', $params); 'orderBy' => 'best', 'maxResults' => '20', ); $results = $plus->activities->search('Google+ API', $params); foreach($results['items'] as $result) { } // The access token may have been updated lazily. $_SESSION['token'] = $client->getAccessToken(); } else { $client->setState($state); $_SESSION['state'] = $state; $authUrl = $client->createAuthUrl(); }
wyskakuje mi taki błąd:
Fatal error: Uncaught exception 'Google_ServiceException' with message 'Error calling GET https://www.googleapis.com/plus/v1/people/me: (403) Insufficient Permission' in /MOJ_HOSTING/system/oauth2_google/io/Google_REST.php:66 Stack trace: #0 /MOJ_HOSTING/system/oauth2_google/io/Google_REST.php(36): Google_REST::decodeHttpResponse(Object(Google_HttpRequest)) #1 /MOJ_HOSTING/system/oauth2_google/service/Google_ServiceResource.php(186): Google_REST::execute(Object(Google_HttpRequest)) #2 /MOJ_HOSTING/system/oauth2_google/contrib/Google_PlusService.php(229): Google_ServiceResource->__call('get', Array) #3 /MOJ_HOSTING/google.php(29): Google_PeopleServiceResource->get('me') #4 {main} thrown in /MOJ_HOSTING/system/oauth2_google/io/Google_REST.php on line 66