.netblazorcommand-line-interface.net-8.0

How to create a Blazor Web App .NET 8 (SSR) project with Authentication using CLI?


I am trying to set up authentication for a Blazor Server-Side Rendering (SSR) application, but I'm encountering an issue when using the dotnet new command with the --auth option. Here's the command I'm trying to run:

dotnet new blazor --auth individual

However, I'm getting the following error:

Error: Invalid option(s):
--auth
   '--auth' is not a valid option
individual
   'individual' is not a valid option

It appears that the --auth option is not recognized for Blazor SSR projects. How can I add authentication to a Blazor SSR application? Is there a different approach or set of commands I should be using?

Thank you for your assistance!


Solution

  • For what it is worth, it looks like Individual account auth option was added to the .NET 8 SSR template in VS 2022 17.8.x latest or .NET8 RC2 of SDK.