1

I am using this library : https://github.com/wanze/Google-Analytics-API-PHP

I am using "service account" method to auth, I generated the p12key, put the ID and email from Google dev console, but I have this error :

{ ["http_code"]=> int(400) ["error"]=> string(13) "invalid_grant" }

I checked on the web, the time on my server is correct, and I look at the library, it use the email as ID, as I saw here : invalid_grant trying to get oAuth token from google

What must I do ? there is no information about this error on Google documentation, which is a mess...

Community
  • 1
  • 1
Vincent Decaux
  • 9,857
  • 6
  • 56
  • 84

1 Answers1

0

Ok actually my server clock was not set properly. I just run :

apt-get install ntp

And it works !

Vincent Decaux
  • 9,857
  • 6
  • 56
  • 84