Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Google API scope drive.file includes drive.metadata

I'm requesting authorization codes using the Google API and specify https://www.googleapis.com/auth/drive.file as the required scope since I'm going to store files on the users drives.

However, when I'm authenticating it says my application requests permission for two scopes, both

View and manage Google Drive files and folders that you have opened or created with this app

and

View metadata for files in your Google Drive

I can verify that I indeed have access to list all files on the drive.

Is the drive.metadata automatically included/required for the scope i'm requesting?

I wish to ask for as few permissions as possible.

like image 978
Vincent Avatar asked Mar 10 '26 23:03

Vincent


1 Answers

Drive v3 scopes

https://www.googleapis.com/auth/drive View and manage the files in your Google Drive

https://www.googleapis.com/auth/drive.appdata View and manage its own configuration data in your Google Drive

https://www.googleapis.com/auth/drive.file View and manage Google Drive files and folders that you have opened or created with this app

https://www.googleapis.com/auth/drive.metadata View and manage metadata of files in your Google Drive

https://www.googleapis.com/auth/drive.metadata.readonly View metadata for files in your Google Drive

https://www.googleapis.com/auth/drive.photos.readonly View the photos, videos and albums in your Google Photos

https://www.googleapis.com/auth/drive.readonly View the files in your Google Drive

https://www.googleapis.com/auth/drive.scripts Modify your Google Apps Script scripts' behavior

You cant view metadata on a file you dont have access to see. Yes you need to be able to see them. Google is smart they know if you want to want to see the metadata your going to have to also need the ability to see the file in question. So yes you are going to need to be able to list it.

like image 157
DaImTo Avatar answered Mar 14 '26 17:03

DaImTo



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!