Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VSCode Extension Authoring - Storage for app secrets?

I am working on an extension that needs to authenticate using OAuth. Is there a storage space in vscode namespace where app secret and access tokens can be stored securely? If not, any suggestions? Thanks!

like image 324
IWon Avatar asked Jan 27 '26 01:01

IWon


2 Answers

Yes, the SecretStorage utility is provided for that. Secrets are persisted across reloads and are independent of the current opened workspace.

API documentation

like image 111
Leor Avatar answered Jan 29 '26 14:01

Leor


TL;DR. No, as of November 2017.

There are some discussions on the credential API for Visual Studio Code extensions(#15414, #31131), but as of November 2017, this feature is stalled and not planned in the near future.

As a workround, you can check globalState and workspaceState in vscode.ExtensionContext as the solution to store data, but you might need to handle encryption/decryption yourself.

like image 23
LazarusX Avatar answered Jan 29 '26 16:01

LazarusX