So, I have this peculiar question. I have a service account with given credentials. I use them both to authenticate myself to Gdrive in the Nodejs app and with rclone. So with Rclone I am able to access the root folder and upload files/ create directories. Using the same credentials, from Nodejs app, using official googleapis npm package and same folder ID, I am unable to list the contents of the root folder. I have tried double checking the credentials and folder Id etc...
My question is, how is it possible that same credentials don't have access to the same folder, given that I have the default scope of /drive and /drive.appdata which should cover everything.
Any ideas on what to try next?
I tried:
- Checking ID and credentials
- Writing bare minimum search query which only lists the folders contents:
const response = await this.drive.files.list({ q:'${parentFolderId}' in parents and mimeType='application/vnd.google-apps.folder', fields: 'files(id)', }); - Using JWT as authentication method with same credentials and scopes as in Rclone config