【问题标题】:setAuthConfig() not working for google calander authsetAuthConfig() 不适用于谷歌日历身份验证
【发布时间】: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


【解决方案1】:

setAuthConfig("粘贴您的 JSON 文件的代码")

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2012-06-05
    • 2019-03-13
    • 1970-01-01
    • 2021-01-11
    • 2021-10-14
    • 1970-01-01
    • 2018-07-23
    • 2012-09-20
    相关资源
    最近更新 更多