Accessing Contents of a Folder With drive.file Scope - Google Drive API

242 Views Asked by At

I'm creating a web-app on top of Google Drive. Althoguh I want to use the most restricting scope (drive.file) I stumbled accros a problem when trying to pick a folder instead of single file. When user picks folder with Google File Picker, my app doesn't get permission to access or even see metadata of files and folders inside that particular folder, which seems counter intuitive.

Everything works well when using non-restrictive .drive scope, but that's not an option since Google asks for verification which seems quite complicated in case of 'restricted' API scopes. I'm currently looking into Google Drive UI integration, but I'm not sure if selecting and opening folder from Google Drive itself makes any difference when it comes to my app seeing file structure inside of that folder. Other option I tried is to use multiple other 'sensitive' API scopes (such as drive.photos.readonly, docs, etc.) but there is a verification process for these scopes as well. I'm not sure whether verification processes differ for sensitive and restricted scopes, but I would surely prefer no verification at all. I know there is an option to select multiple files at once, and to flatten the folder structure in Google File Picker, but I'm not looking for that kind of 'hacky' solution that is degrading to the UX of my app's users.

There have been similar questions asked How can I use the drive.file oauth2 scope with a folder in Google Drive? Does Google Drive's 'per file' scope cascade into child folders/files? but these are from 5/10 years ago, and hopefully something changed in the meanwhile, since this looks like a big flaw in API design by Google.

Did anyone encounter issue(s) similar to this? Or do you have any ideas how to work around this?

0

There are 0 best solutions below