Node JS googleapis vs Rclone authentication

45 Views Asked by At

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:

  1. Checking ID and credentials
  2. 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)', });
  3. Using JWT as authentication method with same credentials and scopes as in Rclone config
0

There are 0 best solutions below