IIS -VS Code - PowerShell Universal Extension - 401 - Error to connect without All Anonymous Users Enabled

Product: PowerShell Universal
Version: 2.3.1

Hi, I installed Universal with IIS using Windows Authentication, all is working fine, site loads, also working with CA signed certificate under https and port 5001. I’m having problems with the VS Code Extension for Powershell Universal, I noticed that I need Anonymous Authentication Enabled in the Authentication Settings for IIS and also an allow rule with “All Anonymous” users to be enabled for it to connect from VS Code, yet when allowing “All anonymous users”, any user with access to the server gets a token autogenerated and is able to see the site etc. If I remove this and use my user token, I get 401 with my account.

Is there any way to connect the Visual Studio Extension to my Universal site without allowing everyone else to log to the server with auto-generated tokens? I’m not sure what combination of settings I can use if any to achieve this.

Same exact things happens even if I check Local Editing in the hosting server, 401 happens without anonymous setup and works when I it’s setup, somehow it seems it still wants to do everything with REST.

For now all I want to achieve is for allowed users under Windows Authentication and Authorization rules to be able to successfully connect the VS Code Posh Universal Extension.

–Just noticed, Invoke-RestMethod requests work with -UseDefaultCredentials switch and not with the bearer token call with just my Windows Authentication setup, is there a way to achieve the same with the Extension?