GustavoASC/google-drive-vscode

Not able to configure credentials

Closed this issue ยท 25 comments

Hello,

I have installed the Google-Drive extension, and I believe I have created the credentials.json file.

When I run Google Drive: Create credentials, a window opens I select the credentials.json file but nothing seems to happen.

I try to display files on my google drive, and keep getting the "credentials need to be configured" error.

Thoughts?

Tom

Hello @Zandar1958, how are you?
Thanks for opening this issue. ๐Ÿ˜ƒ

I suspect the credentials.json file you have downloaded is not configured for Desktop app on Google Console.
I suggest you configure the Google Drive API on your account again, doing the following steps:

  1. Access this link to turn on the Drive API

  2. Click on Enable the Drive API button

  3. On the modal pop-up, make sure you have Desktop app selected, like this:

    image

  4. Click Create

  5. Click Download client configuration

Besides, what OS are you using?
I've tested on Ubuntu 20.04 and Windows 10 and it worked fine for me.

Hope it helps ๐Ÿ˜ƒ

I am using Linux on Chromebook. Debian Buster 10

That's a good information. Thanks!
Can you please check whether recreating the credentials.json file with Desktop app option works for you?

Uhm... actually don't need to have neither node.js nor npm intalled because node.js is already shipped with VSCode.
Have you installed the extension through VSCode Marketplace?

image

Still not having success with getting VSCode to see my Google drive.

Do you keep getting the same problem? "Credentials need to be configured" even after you configure them on the extension... or is it a different problem?

Besides, I will run a Debian GUI/Linux Buster 10 image on VirtualBox and test the extension with this OS.
I have just tested with Ubuntu and Windows 10... maybe there is a problem running this extension on this OS.

I will let you know as soon as I have news.

@Zandar1958 I installed "Debian GNU/Linux 10 (buster)" on a virtual machine and it worked fine for me... I performed these steps:

Access this link to turn on the Drive API
Click on Enable the Drive API button
On the modal pop-up, make sure you have Desktop app selected, like this:
Click Create
Click Download client configuration

Do you have another machine with a different OS to test this extension with the exact same credentials.json file you have previously downloaded? If it works, then I guess it's something related to Chromebook..... (It's just a hypothesis).

When I have a free time I intend to record a gif or a video of my screen, showing every single operation I did to configure the credentials on the extension. I think it will be useful for more people too.

Hi @Zandar1958

When we configure the credentials on the extension, the credentials are stored on the OS key vault.
Windows, Mac and Ubuntu have different built-in key vaults, but looking at this issue:

microsoft/live-share#224
It looks like some versions of Linux do not come with a built-in key vault.

This comment:
microsoft/live-share#224 (comment)

Suggests to run a command on linux terminal to install the keyvault.

@malteA Checking out Arch, you likely don't have gnome-keyring and libsecret installed.
Run
sudo pacman -S gnome-keyring libsecret
Then reboot. Sign in should now work with most window managers. See here for additional details:
https://wiki.archlinux.org/index.php/GNOME/Keyring

I came into this issue because they have reported the same error "The name org.freedesktop.secrets was not provided by any .service files".

Can you please try that on your Chromebook? Maybe the OS key vault is not installed.
If this is the problem, I can add a check on the extension to detect this situation and show a proper notification message.

I've also found people using the command: sudo apt-get install -y gnome-keyring
Maybe this or something similar will work.

Hi @Zandar1958,

So glad you had success connecting to Google Drive ๐Ÿ˜ƒ.

The extension currently uses drive.file scope, so it currently only access files and folders uploaded to Google Drive through the extension itself. This link has the Google Drive API documentation and explains the scope differences.

Please take a look at this comment where I explain this situation in more details.

I believe we have two options to make the extension better and more flexible:

  1. Use Google Picker API, so we can provide access to specific files which have been manually uploaded through Drive website or uploaded through other applications;
  2. Use drive scope instead of drive.file scope, since it provides read and write access to all drive files. The extension could prompt user asking which is the preferred scope.

Unfortunately, the extension has this limitation at the moment, but I intend to make it better as soon as I have a free time... (I am finishing my graduation and the final paper is taking a lot of my time...)

Hi @Zandar1958,

Yes, it's possible to share files and folders across different machines.
To achieve that you need to configure the same credentials.json file on both VSCode installations.

If you check Google API Console there are probably two projects for Google Drive API on your Google account, which generates two different credentials.json and hence they cannot see each other files.

I suggest you to copy the credentials.json file from one machine to another and run the command: Google Drive: Configure Credentials one more time on Command Palette, in order to use the same credentials on both machines.

Hope it helps!

Hi @Zandar1958,

Did you have success using the same credentials.json file across different machines?

I am very happy it worked for you! ๐Ÿ˜ƒ

For the original problem, I have created this wiki with a FAQ section, which contains useful instructions to install missing key vaults like gnome-keyring. Since this problem has been solved, I am going to close this issue and open some new ones to develop the nice features we have cited on previous comments.

Hope you like this extension!
If you have any other doubt or problem, feel free to open new issues as well. ๐Ÿ˜ƒ

Hello @Zandar1958!

Could you open a new issue on the repository for this situation, please? So we can keep the current issue closed for the original problem related to the credentials.

On the new issue, please add:

  1. A screenshot of the problem;
  2. The steps to reproduce it. The extension provides 3 different commands to upload files according to the readme... so I would need to know which one you used. E.g.: uploading through context menu (right mouse click) on the Tree view;
  3. The full file name of calculator.py so I can try to reproduce it here, creating a file with the exact same path.

Thanks in advance!

Yeah, this is meant to be developed on issue #9.
There are other people looking for this feature as well.

It will be really useful! ๐Ÿ˜ƒ