Stop vs code trying to auto log in to all workspace folder
When using VS code with multiple workspaces it requests "The extension 'InterSystems ObjectScript' wants to sign in using InterSystems Server Credentials.
Other than having multiple workspaces per environemnt (which never really works for me in principle as i end up code comparing in one manner or another) is there a way to only have intersystems log in to VS code whenever you open an actual workspace itself i.e. click on dev not on loading vscode.
This would also get around errors of "unauthenticated access rejected by" errors as VS code tries to log in without the password first.
Comments
To prevent VS Code from attempting to automatically log in to all workspace folders when using the InterSystems ObjectScript extension, you can adjust the configuration settings. The InterSystems Server Manager extension facilitates managing server connections, including signing in and storing credentials securely.
Disable Automatic Syncing of Local Changes:
Control Login Behavior for Specific Workspaces:
- Define individual workspace configurations in
.code-workspacefiles. Use these to specify only individual folders that require server access. For example:{ "folders": [ { "name": "SpecificServerNamespace", "uri": "isfs://server:namespace/" } ], "settings": {} } - This setup prevents global login attempts unless the specific workspace is explicitly opened 34.
- Define individual workspace configurations in
Work with Temporary Credentials:
Sign-out and Manage Trusted Extensions:
- Regularly manage signed-in accounts from the VS Code Accounts menu. You can sign out of any account to ensure the credentials are not auto-retrieved on subsequent VS Code launches. Additionally, restrict or manage extension access to InterSystems Server Credentials 5.
Using these approaches, you should be able to control when and how InterSystems connections are established when working with multiple workspaces in VS Code.
Sources:
When you launch VS Code I wonder if what's happening is that it's reopening whichever workspace was open at the time you last exited VS Code. To test this theory please use the "Close Workspace" option from the File menu before you exit from VS Code. Then the next time you launch VS Code do you still get the sign-in permission request?
Also, are you editing server-side (i.e. the old Studio paradigm), or client-side? And is your desktop Windows or macOS or a Linux variant?
This is an intentional design decision. We think it's a better user experience to prompt for login at the start, and after login we cache some information about your server-namespace environment that is used throughout the session. You can get the behavior you want by having separate workspaces for the folders that you don't usually use together. Then when you open one of them you'll only be prompted for the server connection for that one. You can also consider putting the credentials in plain text in the intersystems.servers block. Then you'll never be prompted. This isn't secure though.
Thanks the option to have this off would be nice. I appreciate the standard logic as a "sign in once" design, it just becomes an annoyance of a multi system multi tie model on one workspace which i suspect having one workspace in the norm as someone just then opens the server they want from that. I could have 6 login prompts every time when I only want to select one of those 6
Also saving passwords has led to somewhere a password getting cached and kept locking out my AD account dispite updating them all and had to reset studio extension completely so don't want to save passwords
Re the AD lockout caused by saved passwords, I assume this was after you had changed your AD password. After doing that did you use the Accounts button at the bottom of the VS Code Activity Bar to sign out the connections that used this AD account, and opt to delete the saved password for each?
Mark, I found that the latest realease was causing VScode to be too slow when loading and it became unusable due performace issues. We downgraded the VS code objecscipt extension from 3.6.0 to 3.4.0 and it resolved the issue. Please note you may have to create a new connection since the update also create issues with cached credentials.
@Sergio Mundarain Can you please open an issue on https://github.com/intersystems-community/vscode-objectscript/issues with screenshots and steps to reproduce your issue?