Repository: vscode
Issue: Allow safestorage api to detect presence of libsecret or kwallet if the desktop environment is unknown
Labels: bug,upstream,linux,electron,keychain

<!-- ⚠️⚠️ Do Not Delete This! bug_report_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- 🕮 Read our guide about submitting issues: https://github.com/microsoft/vscode/wiki/Submitting-Bugs-and-Suggestions -->
<!-- 🔎 Search existing issues to avoid creating duplicates. -->
<!-- 🧪 Test using the latest Insiders build to see if your issue has already been fixed: https://code.visualstudio.com/insiders/ -->
<!-- 💡 Instead of creating your report here, use 'Report Issue' from the 'Help' menu in VS Code to pre-fill useful information. -->
<!-- 🔧 Launch with `code --disable-extensions` to check. -->
Does this issue occur when all extensions are disabled?: Yes

<!-- 🪓 If you answered No above, use 'Help: Start Extension Bisect' from Command Palette to try to identify the cause. -->
<!-- 📣 Issues caused by an extension need to be reported directly to the extension publisher. The 'Help > Report Issue' dialog can assist with this. -->
- Version: 1.80.0-insider
- Commit: 6545c4c2671127c323182225963fcd732e1fbcc5
- Date: 2023-06-15T05:34:31.245Z
- Electron: 22.5.7
- Chromium: 108.0.5359.215
- Node.js: 16.17.1
- V8: 10.8.168.25-electron.0
- OS: Linux x64 6.1.0-9-amd64
- Distro: Debian sid/unstable

### Steps to Reproduce:

1. Open vscode
2. Authenticate on github
3. Close vscode
4. Open vscode again

vscode will ask again for authentication.


### Description

Latest insiders version seems to have problems handling the github session storage on the keyring, It asks for login every time the application is opened.

I have checked this guide:
https://code.visualstudio.com/docs/editor/settings-sync#_troubleshooting-keychain-issues

Everything works fine in the stable version. If I delete the keyring the stable version asks to create a new one, the insiders version does not.

Also have tried wiping all the insiders version config files and start from scratch without any luck.

### Logs

Github authentication logs when opening vscode:
```
2023-06-15 13:02:34.802 [info] Reading sessions from keychain...
2023-06-15 13:02:34.802 [info] Getting sessions for all scopes...
2023-06-15 13:02:34.802 [info] Getting sessions for user:email...
2023-06-15 13:02:34.802 [info] Getting sessions for user:email...
2023-06-15 13:02:34.802 [info] Getting sessions for read:user...
2023-06-15 13:02:34.802 [info] Getting sessions for read:user...
2023-06-15 13:02:34.802 [info] Got 0 sessions for ...
2023-06-15 13:02:34.802 [info] Got 0 sessions for user:email...
2023-06-15 13:02:34.802 [info] Got 0 sessions for user:email...
2023-06-15 13:02:34.802 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.802 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.802 [info] Getting sessions for all scopes...
2023-06-15 13:02:34.802 [info] Got 0 sessions for ...
2023-06-15 13:02:34.942 [info] Getting sessions for read:user...
2023-06-15 13:02:34.942 [info] Got 0 sessions for read:user...
2023-06-15 13:02:34.942 [info] Getting sessions for user:email...
2023-06-15 13:02:34.942 [info] Got 0 sessions for user:email...
2023-06-15 13:02:35.011 [info] Getting sessions for all scopes...
2023-06-15 13:02:35.011 [info] Got 0 sessions for ...
```

After logging in:
```
2023-06-15 14:05:40.593 [info] Logging in for the following scopes: user:email
2023-06-15 14:05:40.594 [info] Trying without local server... (user:email)
2023-06-15 14:05:41.790 [info] Exchanging code for token...
2023-06-15 14:05:42.145 [info] Token exchange success!
2023-06-15 14:05:42.149 [info] Getting user info...
2023-06-15 14:05:42.481 [info] Got account info!
2023-06-15 14:05:42.482 [info] Storing 1 sessions...
2023-06-15 14:05:42.487 [error] Setting token failed: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.
2023-06-15 14:05:42.487 [info] Stored 1 sessions!
2023-06-15 14:05:42.487 [info] Login success!
2023-06-15 14:05:42.492 [info] Getting sessions for user:email...
2023-06-15 14:05:42.492 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.493 [info] Getting sessions for user:email...
2023-06-15 14:05:42.493 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.497 [info] Getting sessions for user:email...
2023-06-15 14:05:42.497 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.497 [info] Getting sessions for user:email...
2023-06-15 14:05:42.497 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.513 [info] Getting sessions for user:email...
2023-06-15 14:05:42.513 [info] Got 1 sessions for user:email...
2023-06-15 14:05:42.514 [info] Getting sessions for read:user...
2023-06-15 14:05:42.514 [info] Got 0 sessions for read:user...
2023-06-15 14:05:42.527 [info] Getting sessions for user:email...
2023-06-15 14:05:42.527 [info] Got 1 sessions for user:email...
```

Never seen this error before:
> [error] Setting token failed: Error: Error while decrypting the ciphertext provided to safeStorage.decryptString. Encryption is not available.