tôi đang theo ví dụ nàyBắt AccessTokenRefreshError: invalid_grant trong Google API fro tài khoản dịch vụ
https://code.google.com/p/google-api-python-client/source/browse/samples/service_account/tasks.py
credentials = SignedJwtAssertionCredentials(
'[email protected]',
key,
scope='https://www.googleapis.com/auth/tasks')
http = httplib2.Http()
http = credentials.authorize(http)
service = build("tasks", "v1", http=http)
# List all the tasklists for the account.
lists = service.tasklists().list().execute(http=http)
pprint.pprint(lists)
Vấn đề là, nó hoạt động và đôi khi tôi nhận được danh sách như JSON và sau khi chạy chương trình ít hơn lần tôi gặp lỗi
File "/usr/local/lib/python2.7/site-packages/oauth2client/client.py", line 710, in _do_refresh_request
raise AccessTokenRefreshError(error_msg)
oauth2client.client.AccessTokenRefreshError: invalid_grant