I have a GAE project (python 2.7 runtime) that uses the Google Calendar API v3. Up until last week, I had been using the default GAE service account to connect to the calendar API, and the service account was given read/write permission to the calendar under calendar sharing settings.
Since last Thursday Oct 20, the service account cannot write to the calendar (events.post or events.patch) -- returns a 403 Forbidden -- and reads (events.list) return 200, but no records. Checking the permissions for the account under calendar sharing, it has been changed to "See Free/Busy only".
I believe this is related to this announcement from Google about winding down OAuth 1.0 service accounts on Oct 20: https://developers.googleblog.com/2016/04/saying-goodbye-to-oauth-10-2lo.html
The recommendation seems to be to grant Domain Wide Delegation to the service account: https://developers.google.com/identity/protocols/OAuth2ServiceAccount#delegatingauthority
We have followed the instructions on this page, but it doesn't work using either AppAssertionCredentials or ServiceAccountCredentials.
More details at this SO question:
http://stackoverflow.com/questions/40223292/google-app-engine-auth-for-google-apis-using-service-account
Thanks for any light you can shine on this problem.
Hello Eric!More detail is needed, to investigate your problem:- About the client library: language, version (GData, API Client ?).
- API scopes?
- The actual URL posted in your app call.
- Are there other accounts affected, or just one, or few?
- In case an account works well, email address and user?- Any part of your code you deem significant.- Request output.
Hello Eric!
For your new service accounts, your code imports credentials from a stored JSON file, which is one of the possible alternatives, all of which should work well.
How did you grant domain-wide access to your service account, exactly?
Did you then implement the OAuth2WebServerFlow as described on the “OAuth 2.0” page?
If you delegated domain-wide access to your service account successfully, you need to use the "delegated_credentials = credentials.create_delegated('us...@example.org')" statement to impersonate a user with the service account, as indicated at the “Delegate domain-wide authority” paragraph on the “Using OAuth 2.0 for Server to Server Applications” page.
I hope this helps for now. I’ll look at your code and try to reproduce the bug meanwhile, waiting for your reply.
Credentials object from the service account's credentials and the scopes your application needs access to.create_delegated method of an existing ServiceAccountCredentials object. authorize method of the Credentials object to apply the necessary credential headers to all requests made by an httplib2.Http instance.