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

Requires update for .NET 8.0 #34742

Closed
sussexrick opened this issue Feb 15, 2025 · 4 comments · Fixed by #34753
Closed

Requires update for .NET 8.0 #34742

sussexrick opened this issue Feb 15, 2025 · 4 comments · Fixed by #34753

Comments

@sussexrick
Copy link

sussexrick commented Feb 15, 2025

Description

The instructions provided for this article generate an unsupported .NET 7.0 example project. Simply upgrading packages and projects to .NET 8 results in a broken application.

The --framework "net8.0" switch is not recognised when used with the provided command line. If you remove -ho from the provided command line --framework "net8.0" works, but the output is not the intended application.

Page URL

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/hosted-with-microsoft-entra-id?view=aspnetcore-7.0

Content source URL

https://github.com/dotnet/AspNetCore.Docs/blob/main/aspnetcore/blazor/security/webassembly/hosted-with-microsoft-entra-id.md

Document ID

46ac86e5-52ba-d8a5-149d-b2f5eb439bab

Article author

@guardrex

Metadata

  • ID: 46ac86e5-52ba-d8a5-149d-b2f5eb439bab
  • PlatformId: 7e66caab-923a-949d-c765-7c115f1d44ad
  • Service: aspnet-core
  • Sub-service: blazor

Related Issues

Copy link
Contributor

🌱🐇 Spring is coming. Hang in there! I'm pull'in for ya! 🐣🌻

Stand-by! ... A green dinosaur 🦖 will be along shortly to assist.

@guardrex
Copy link
Collaborator

Hello @sussexrick ... You are looking at the 7.0 version of the article, so the guidance is correct for 7.0. If you flip to a later version (8.0 or later), you will get the notice that the 7.0 version is the latest version ...

You have been redirected to the newest product version available for this page.

What's going on here is that the Hosted Blazor WebAssembly project template was dropped from the framework for the 8.0 release. It's no longer recommended that that project type be used for new projects. The article (7.0 or earlier) is maintained for backwards compat with 7.0 or earlier apps.

I think the best way to handle this situation is for me to add a notice to the top of the article indicating the situation with the template and probably a recommendation that devs move to either a Blazor Web App or pure Blazor WebAssembly app.

Leave this issue open. I'll add a notice on Monday to this article and a few others that were focused on the Hosted Blazor WebAssembly template. When the PR merges later, the issue will automatically close. Let me know if you have any further questions on this. If I can't answer, I'll try to get an answer for you.

@guardrex guardrex moved this from Triage to P0/P1 - High Priority in Blazor.Docs Feb 16, 2025
@sussexrick
Copy link
Author

sussexrick commented Feb 16, 2025

Thank you for the clarity.

Yes, I do have a further question. I'm looking for a sample implementation of a Blazor WASM app calling a secure API. Can you recommend one? I thought this was it, but clearly not.

I also tried https://learn.microsoft.com/en-us/aspnet/core/blazor/security/blazor-web-app-with-oidc but:

  • it produces complex code for maximum flexibility and states that it could be a lot simpler with the Microsoft.Identity.Web package

  • when you log out it displays a message about not logging you out correctly (as does the code from this .NET 7.0 article)

    Image

@guardrex
Copy link
Collaborator

guardrex commented Feb 16, 2025

That's not for Standalone Blazor WebAssembly. The article that we maintain for Blazor WASM, including calling a secure API, is ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-authentication-library?view=aspnetcore-9.0&tabs=visual-studio

... and that's for using the Microsoft Authentication Library (MSAL).

A cookie-based approach with the new Map Identity API and MS Identity and with a secure web API call is at ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/standalone-with-identity/?view=aspnetcore-9.0

The first article explains how to create the app. The second article cross-links a sample app in the Blazor samples repo.

WRT additional work on secure web API for the Call web API article ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/call-web-api?view=aspnetcore-9.0

I'm considering adding new, general security guidance. I'll analyze the coverage and think it over 🤔 this week. One or two devs over the last couple of years have asked for additional remarks there.

There's good additional coverage in the WASM Additional scenarios article at ...

https://learn.microsoft.com/en-us/aspnet/core/blazor/security/webassembly/additional-scenarios?view=aspnetcore-9.0

I have a goal of performing a security assessment on where/how we're covering these subjects. Let me look further this week. I'll probably open a new issue with some ideas to improve our coverage on this challenging subject.

@guardrex guardrex moved this from P0/P1 - High Priority to In progress in Blazor.Docs Feb 18, 2025
@github-project-automation github-project-automation bot moved this from In progress to Done in Blazor.Docs Feb 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

2 participants