GAPI: Failed to authenticate user. Permanent fix PHP [closed]

只愿长相守 提交于 2019-11-27 08:05:40

问题


I am trying to fetch content from the GAPI it works sometimes but the other times it throws this error:

Exception GAPI: Failed to authenticate user. Error: "https://developers.google.com/accounts/docs/AuthForInstalledApps "

I browsed through all the answers but couldn't find a solution. I tried using both of these links previously:

https://accounts.google.com/DisplayUnlockCaptcha

https://www.google.com/settings/security/lesssecureapps

It used to work but not anymore, can someone help?


回答1:


Failed to authenticate user

Means there is something wrong with your authentication.

GAPI hasn't been worked on since 2009. It also appears to use client login which was discontinued / shutdown on April 20 2015. You can no longer use client login with Google Analytics API, you need to switch to Oauth2 or a service account. So either the author of that project needs to fix his code, it appears to be an open source project so you could probably fix it for him.

In my opinion Google PHP client library probably a better solution.

tutorials:

  1. My Tutorial Google Analytics API php Oauth2
  2. My Tutorial Google Analytics api php service account
  3. Googles Tutorial embedded api


来源:https://stackoverflow.com/questions/30474122/gapi-failed-to-authenticate-user-permanent-fix-php

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!