Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can't debug ASP.NET Core hosted Blazor WebAssembly app under windows authentication #29504

Closed
bryp opened this issue Jan 21, 2021 · 8 comments
Closed
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved

Comments

@bryp
Copy link

bryp commented Jan 21, 2021

Hi folks, I am unable to debug an ASP.NET Core hosted Blazor WebAssembly app. The server project uses windows authentication. Steps to reproduce are simple and listed below.

Create a new ASP.NET Core hosted Blazor WebAssembly app.
image

Enable Windows Authentication on the Server project.
image

Press F5 to debug. My web browser is set to Chrome. Receive the following error message.
image

About Visual Studio
image

Attached please find visualstudio-js-debugger.txt.
visualstudio-js-debugger.txt

@Pilchie Pilchie added the area-blazor Includes: Blazor, Razor Components label Jan 21, 2021
@javiercn javiercn added feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly labels Jan 21, 2021
@javiercn
Copy link
Member

@bryp thanks for contacting us.

@captainsafia do you know what's going on here? (I believe i've seen this reported in the past). Feel free to close it if there is an existing issue for it or a known answer.

@javiercn javiercn added this to the Next sprint planning milestone Jan 25, 2021
@ghost
Copy link

ghost commented Jan 25, 2021

Thanks for contacting us.
We're moving this issue to the Next sprint planning milestone for future evaluation / consideration. We will evaluate the request when we are planning the work for the next milestone. To learn more about what to expect next and how this issue will be handled you can read more about our triage process here.

@bryp
Copy link
Author

bryp commented Jan 25, 2021

Next sprint planning? FWIW - this one is blocking Blazor Wasm adoption at my company. Hard to believe one can't be able to debug under windows authentication, can someone help me to figure out a work around?

@javiercn
Copy link
Member

@bryp this is our standard process for dealing with issues.

I've dug out the issue tracking improvements for Blazor Webassembly debugging #22589, there's a more general issue #27301 and this is a known issue in 5.0

See here for details. The issue mentions a workaround, but I don't seem to be able to find it by skimming the docs.

I understand that this might not be what you want to hear, I can only suggest you switch to a different auth scheme (one of the ones we support out of the box) or replace/turn-off windows auth when you want to debug the application.

Also, as a side note, we don't recommend using Windows Auth with single page applications unless you take appropriate steps to further protect your app against CSRF attacks

@javiercn javiercn added the ✔️ Resolution: Duplicate Resolved as a duplicate of another issue label Jan 25, 2021
@ghost ghost added the Status: Resolved label Jan 25, 2021
@javiercn javiercn removed this from the Next sprint planning milestone Jan 25, 2021
@javiercn
Copy link
Member

@captainsafia if you know a workaround for this, feel free to comment/point to the docs.

I'm closing this issue since it's a duplicate of #27301

@bryp
Copy link
Author

bryp commented Jan 25, 2021

@javiercn This is certainly disappointing. To be clear, you do support Windows Auth out of the box. You just don't support debugging Windows Auth out of the box for Wasm, which makes this issue all the more strange. Also, as a side note, CSRF attacks have nothing to do with Windows Auth so CSRF protection applies to all Auth schemes and of course is good practice.

@captainsafia
Copy link
Member

To be clear, you do support Windows Auth out of the box. You just don't support debugging Windows Auth out of the box for Wasm, which makes this issue all the more strange

This is correct. The implementation for debugging .NET on WASM is a little bit different than .NET on the Server which is why this issue presents itself here.

@bryp If you're up for it, you can try manually launching the debug proxy to see if that resolves the issue. To do that, you will need to:

  1. Find the location of the BrowserDebugHost.dll assembly in the Microsoft.AspNetCore.Components.WebAssembly.DevServer package.
  2. Launch the debugging proxy using dotnet BrowserDebugHost.dll.
  3. Copy the address the server from Replace batch files with KVM #2 is listening on.
  4. Modify the launchSettings.json file of your and update the inspectUri to the following:
"inspectUri": "ws://127.0.0.1:{portNumberFromStep2}/ws-proxy?browser={browserInspectUri}"
  1. Start debugging in VS/VS Code.

@bryp
Copy link
Author

bryp commented Jan 25, 2021

@captainsafia Thank you for the try but it didn't work. Still get the same "Failed to launch debug adapter" error.

@ghost ghost locked as resolved and limited conversation to collaborators Feb 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-blazor Includes: Blazor, Razor Components feature-blazor-debugging This issue is related to debugging of Blazor WebAssembly apps feature-blazor-wasm This issue is related to and / or impacts Blazor WebAssembly ✔️ Resolution: Duplicate Resolved as a duplicate of another issue Status: Resolved
Projects
None yet
Development

No branches or pull requests

4 participants