visual-studio-codesource-maps

VS Code Aug 2023: How can source maps be automatically loaded from authenticated endpoints


The release notes from the newest (Aug 2023) VS Code release says:

Source maps can now be automatically loaded from authenticated endpoints

That's great! But to use this, we need some more info:

I haven't been able to find any info on this in the release notes or VS Code docs. I would expect more info on the browser debugging page or the Node debugging page. This seems like a browser debugging feature, b/c securing source maps seems more critical for front-end code than back-end code.


Solution

  • I also posted this question on VS Code github and learned that as of VS Code 1.82 (Aug 2023) the javascript debugger now uses the browser's network stack to issue source map file requests. So that means:

    1. This works for Edge and Chrome browser debugging in VS Code
    2. The types of authentication supported are limited to those that work automatically from browser dev tools.

    For example cookie authentication (where the server sets the cookie for the origin) and client certificate authentication (where the browser accesses the cert from a store) should work.

    Basic and digest authentication and OAuth/OpenID Connect require headers set on the client when issuing the request, so these types of authentication won't work in browser dev tools or in VS Code.