diff --git a/php/ContentSession.php b/php/ContentSession.php index 8893ba1..db0c8a3 100644 --- a/php/ContentSession.php +++ b/php/ContentSession.php @@ -299,29 +299,8 @@ public function getHome() { return rtrim($home, '\\/'); } - private function getToken(Google_Client $client) { - $client->setRedirectUri('urn:ietf:wg:oauth:2.0:oob'); - $client->setScopes('https://www.googleapis.com/auth/content'); - $client->setAccessType('offline'); // So that we get a refresh token - - printf("Visit the following URL and log in:\n\n\t%s\n\n", - $client->createAuthUrl()); - print ('Then type the resulting code here: '); - $code = trim(fgets(STDIN)); - $client->authenticate($code); - - return $client->getAccessToken(); - } - protected function cacheToken(Google_Client $client) { - print (str_repeat('*', 40) . "\n"); - print ("Your token was missing or invalid, fetching a new one\n"); - $token = $this->getToken($client); - $tokenFile = join(DIRECTORY_SEPARATOR, - [$this->configDir, self::OAUTH_TOKEN_FILE_NAME]); - file_put_contents($tokenFile, json_encode($token, JSON_PRETTY_PRINT)); - printf("Token saved to %s\n", $tokenFile); - print (str_repeat('*', 40) . "\n"); + throw new Exception('This example currently only supports the service account flow..'); } /**