1
votes

So I provide my credentials along with a python script to allow downloading some files from my Google Drive. I tried using these scopes but they all fail:

Only this one worked: https://www.googleapis.com/auth/drive

But this token is asking the user to give read, write, edit, access to Google Drive. Why do they need to have all of these permissions, just to be able to download files from another Google Drive i.e. mine?

I can't find the minimum scope that I need for this operation.

I am using the Google Drive API in python.

1
In the case of download the file and https://www.googleapis.com/auth/drive can be used, how about using https://www.googleapis.com/auth/drive.readonly instead of https://www.googleapis.com/auth/drive? The official document says Allows read-only access to file metadata and file content.. Ref - Tanaike
Thanks yesterday I figured it out googleapis.com/auth/drive.readonly indeed worked. You can reply for this so I can mark it as answer if you want. - Joan Venge
Thank you for replying. I'm glad your issue was resolved. I thought that your question and solution will be useful for other users. From your proposal and this, I posted it as an answer. Could you please confirm it? - Tanaike

1 Answers

2
votes

From your question, it was found that https://www.googleapis.com/auth/drive can be used. From this situation, as the scope for downloading the file, I think that the following scope can be used.

https://www.googleapis.com/auth/drive.readonly

The official document says about this scope as follows.

Allows read-only access to file metadata and file content.