You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think when the migration is done here #89, we can add support for GoogleCredentials.get_application_default(). I think it would be very handy. We can add an explicit method ApplicationDefaultAuth for this.
I'm hesitant to do it now, since oauth2client is deprecated and we need to migrate from it first.
shcheklein
changed the title
Documentation: Replacing pydrive with pydrive2 in Google Colaboratory (Colab)
Support default env credentials (e.g. needed in Google Colaboratory (Colab)) + workaround for now
Jul 24, 2022
I was about to create a new issue but I think this one cover my use case: I would like to use PyDrive2 on a Google App Engine, without using a JSON key file, but authenticating with the default Service Account.
I tried the workaround above but it yields to a 403 error
ApiRequestError: <HttpError 403 when requesting https://www.googleapis.com/drive/v2/files?q=MyDriveId+in+parents+and+trashed%3Dfalse&maxResults=1000&supportsAllDrives=true&includeItemsFromAllDrives=true&alt=json returned "Insufficient Permission: Request had insufficient authentication scopes.". Details: "[{'domain': 'global', 'reason': 'insufficientPermissions', 'message': 'Insufficient Permission: Request had insufficient authentication scopes.'}]">
I know my Service Account has enough permissions to access the Drive because it works with a JSON key file.
Am I missing something? Any chance to see this issue resolved in the near future?
Google Colaboratory provides these instructions for using PyDrive: https://colab.research.google.com/notebooks/snippets/drive.ipynb#scrollTo=bRFyEsdfBxJ9
Running the same code, but substituting
pydrive2
forpydrive
, produces errors as collapsed here.The google-colab package would monkey-patch pydrive to avoid these errors.
To monkey-patch pydrive2 in the same way, you need to:
Then, you can use the same code as in Google Colaboratory's instructions.
The text was updated successfully, but these errors were encountered: