【发布时间】:2016-11-25 01:13:45
【问题描述】:
我正在尝试使用 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 {主}
在 171 行的 /var/www/myinvitebig.com/vendor/google/apiclient/src/Google/Client.php 中抛出
我的 cli.json 文件是正确的。 这是我的代码。 请建议我该怎么做?
$client->setAuthConfig('cli.json');
$client->refreshToken($rToken);
$refreshToken = $client->getAccessToken();
echo "==>".$refreshToken;
【问题讨论】:
-
Hi harish 试试这种方法,将你的 json 文件代码粘贴到 setAuthConfig() 中
标签: php google-api google-calendar-api