Closed sivabalan02 closed 8 years ago
Can you paste your code so we can see what you might be doing wrong? From the information you've provided, there really isn't any way we can help.
Hai bshaffer, sorry for late reply. I updated the issue with the code itself
@sivabalan02 I am not sure where the problem is... however, this flow has been deprecated in favor of the v2.0 version of this library, which you can learn more about here.
I suggest trying to pull down the latest version and using the new method of assertion credentials. Note you'll need to use a json
credentials file instead of the p12
you're currently using.
@sivabalan02 After extensive testing, it looks like newly generated P12 files are no longer usable in v1 at all. Tested Google_Service_Analytics::ANALYTICS_READONLY
scope only. Even the JSON files using v1 don't seem to play nicely.
Here is the code and documentation changes we used for the upgrade from 1.0 to 2.0, it might help you.
@daftspunk Interesting. What is the error you are receiving, and does it seem to be an issue with the PHP Library or with the Google APIs?
All old P12 files that were set up prior to the Google Developer Tools UI changes are working fine with the v1 library. Any new accounts with P12 files receive the invalid_grant error even using the identical PHP code base. It leads me to believe it is an issue with the API.
When attempting to use the JSON file for auth, v1 was looking for a key called "client_secret" in the JSON file which is missing from those newly generated by the Dev Tools. Among other missing keys, it outputs error Invalid client secret JSON file. I do not have an old [working] JSON file from the previous Dev Tools to compare with.
Ahh, interesting. I know the p12
method is deprecated, so it is very likely those specific APIs have been intentionally phased out for all but legacy credentials.
Hi all, I am using google api on my yii2 project which gives an error as follows:
Google_Auth_Exception
Error refreshing the OAuth2 token, message: '{ "error" : "invalid_grant" }'
in the file vendor/google/apiclient/src/Google/Auth/OAuth2.php
I gave the service account email as my google's developer email address
Please someone help me get out of this
This is my code: