doufu7464 2016-10-18 08:14
浏览 66

带有“请求包含无效身份验证凭据”的Google Analytics Reporting API V4

We use this walk through, to set up our tool. Hello Analytics Reporting API V4; PHP quickstart for service accounts

Here is the example from the walkthrough https://advertisebg.com/report1610/GA/HelloAnalytics.php and the code is Exactly the same as in the example

Fatal error: Uncaught Google_Service_Exception: { "error": { "code": 401, "message": "Request had invalid authentication credentials.", "errors": [ { "message": "Request had invalid authentication credentials.", "domain": "global", "reason": "unauthorized" } ], "status": "UNAUTHENTICATED" } } in /home/advbg/public_html/report1610/GA/src/Google/Http/REST.php:118 Stack trace: #0 /home/advbg/public_html/report1610/GA/src/Google/Http/REST.php(94): Google_Http_REST::decodeHttpResponse(Object(GuzzleHttp\Psr7\Response), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...') #1 /home/advbg/public_html/report1610/GA/src/Google/Task/Runner.php(181): Google_Http_REST::doExecute(Object(GuzzleHttp\Client), Object(GuzzleHttp\Psr7\Request), 'Google_Service_...') #2 /home/advbg/public_html/report1610/GA/src/Google/Http/REST.php(58): Google_Task_Runner->run() #3 /home/advbg/public_html/report1610/GA/src/Google/Client.php(782): Google_Http_REST::execute(Object(GuzzleHttp\Client), in /home/advbg/public_html/report1610/GA/src/Google/Http/REST.php on line 118

After several hours without any problems we receives the following error “Request had invalid authentication credentials”

Several times we restart with new project, recreate the Credentials, install new example and every time - the same result, after having working well for couple of hours, we see the error above.

Any ideas?

  • 写回答

1条回答 默认 最新

  • dongluoqiu0255 2016-10-18 08:52
    关注

    It looks like this might be a problem with the Google PHP client library there is current a issue going on the forum for it.

    Sporadic "Invalid Credentials" Issues - Service Account

    The client library should be refreshing authentication for you seams it isn't. Might be worth following the issue.

    评论

报告相同问题?

悬赏问题

  • ¥15 BP神经网络控制倒立摆
  • ¥20 要这个数学建模编程的代码 并且能完整允许出来结果 完整的过程和数据的结果
  • ¥15 html5+css和javascript有人可以帮吗?图片要怎么插入代码里面啊
  • ¥30 Unity接入微信SDK 无法开启摄像头
  • ¥20 有偿 写代码 要用特定的软件anaconda 里的jvpyter 用python3写
  • ¥20 cad图纸,chx-3六轴码垛机器人
  • ¥15 移动摄像头专网需要解vlan
  • ¥20 access多表提取相同字段数据并合并
  • ¥20 基于MSP430f5529的MPU6050驱动,求出欧拉角
  • ¥20 Java-Oj-桌布的计算