setAuthConfig()不适用于google calander auth

时间:2016-07-21 12:28:13

标签: php google-api google-calendar-api

我正在尝试使用setAuthConfig()进行身份验证。 但我收到了一个错误。

致命错误:未捕获的异常“Google_Exception”,消息“无效的客户端密钥JSON文件”。在/var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php:171 堆栈跟踪:

0 /var/www/myinvitebig.com/calsync.php(57):Google_Client-> setAuthConfig('cli.json')

1 {main}

/b/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php 171 p>

我的cli.json文件是正确的。 这是我的代码。 请建议我做什么?

$client->setAuthConfig('cli.json');
$client->refreshToken($rToken);
$refreshToken = $client->getAccessToken();

echo "==>".$refreshToken;

1 个答案:

答案 0 :(得分:1)

setAuthConfig(“粘贴你的JSON文件的代码”)