'Visual Studio Code asking to authenticate 'Default keyring' everytime I start

I started using Linux lite 5.0 on my laptop last month. (I am fairly new to the Linux enviroment, just migrated from Windows 10).

So I installed Visual studio Code using snap and everytime I start it up, it asks to authenticate 'Default Keyring' until next reboot.

Is there anyway I can authorize it so I don't have to authenticate it everytime i reboot my pc?

(p.s the reason i moved from windows to linux is because my pc got hacked some weeks prior, so please consider security a major concern here)

Thanks in advance :)



Solution 1:[1]

In GDM+GNOME, when you login, GNOME Keyring is automatically unlocked. However, it doesn't do so in SDDM+KDE. When you start some GNOME or Electron application like VS Code, they ask you to type the login password again.

The solution is to edit /etc/pam.d/sddm and add pam_gnome_keyring.so like this (the second line and last line):

#%PAM-1.0
auth     include        common-auth
auth     optional       pam_gnome_keyring.so
account  include        common-account
password include        common-password
session  required       pam_loginuid.so
session  include        common-session
session  optional       pam_gnome_keyring.so auto_start

This is a solution that I found here that should work for you. For me, the lines were already there, but I simply had to remove the - at the beginning of the lines.

EDIT: To edit the file, you'll need root privileges, so I did sudo -e /etc/pam.d/sddm in terminal, edited the lines, hit CTRL+X, and Y to save.

Solution 2:[2]

This has nothing to do with visual studio, keyrings is a package in your system used to store your passwords read more about keyrings here

to solve your problem open gnome-shell and search: "seahorse"

open it and you will find all your keyrings setup, the default one is what you want, select it right-click to edit or delete it if you are not remembering the password

But NOTE before you delete it any configurations with this keyring "default keyring" will be deleted with it too

Solution 3:[3]

For anyone using VSCode on Windows / WSL - this is the solution https://github.com/MicrosoftDocs/live-share/issues/1782#issuecomment-1053563079

Go to your wsl terminal and install seahorse if you don't have it.

sudo apt-get update && sudo apt-get install seahorse

Run seahorse

seahorse

You should see a popup for GnuPG keys. Click on the back button, then right-click on default keyring, and click delete. After entering your keyring password, your default keyring should be gone.

But now vscode asks you to create one every time. To fix this remove gnome-keyring:

sudo apt-get remove gnome-keyring

Credits go to Austin Jerry (upsurge0)

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Leonivek
Solution 2
Solution 3 nsimeonov