Hey there! I need to let users upload documents from their Google Drive accounts. And as we’re already using Uppy, Remote Sources seemed like a good way to go.
Problem
I’m going for the Transloadit setup, so I’m following these instructions, using COMPANION_URL and COMPANION_ALLOWED_HOSTS from @uppy/transloadit.
However, every time I want to connect to any remote source (Google Drive, Dropbox), the request to Transloadit (e.g. https://api2.transloadit.com/companion/drive/list/root in the case of Google Drive) gets a 401.
Reproducing
In order not to include any of my own code, this issue is easily reproducible in the canonical example at Uppy.
- Go to Uppy
- Click on StackBlitz
- Comment out the lines with
Audiosince it’s missing in the deps, and we’re not using it. - In the preview app, click on Google Drive (or Dropbox, or others) and in the developer tools see the request returning a 401.
- We can disregard the failed request, go on and connect to a Google Drive account, but after that we cannot move forward, due to a message like this:
Versions
This is happening at least with Uppy v4.13.3 and the versions in the canonical example.
Comments
- When changing the Remote Sources plugin for the Google Drive or Dropbox the same happened: 401 on similar requests.
- I also tried using my own OAuth credentials, stored in my Transloadit account, including the
companionKeysParams: {
key: 'YOUR_TRANSLOADIT_API_KEY',
credentialsName: 'my_companion_dropbox_creds',
},
object in GoogleDrive plugin init, but with identical results.
- A similar issue is faced when running the Transloadit example.
Wrap
Perhaps it’s some obvious config issue, but I’ve gone through all the docs available and many threads in the forum and while finding similar cases, no solution for this problem. Hope it helps others also. I think the tool is great and these issues should not discourage people from using it.