Forum Discussion

Rod_Falanga_DOH's avatar
Rod_Falanga_DOH
Copper Contributor
Aug 27, 2024

Blazor has turned out to be a massive disappointment, will it ever get Windows Authentication?

Blazor is a technology I've been hearing about for a couple of years. It sounds like it would be great, especially for not having to write any JavaScript code, unless it is absolutely necessary. I maintain a very old classic ASP.NET WebForms application which has a lot of issues that greatly add technical debt. I have finally convinced my management to let me rewrite this application, and it was my intention to use Blazor in .NET 8. I started a few weeks back.

 

The number one thing is this app MUST use Windows Authentication as it is an Intranet app, working within our corporate firewall. No exceptions!!!

 

I thought at one point that I had found a solution, but then I discovered that when creating the project and selecting Windows Authentication, Visual Studio was changing it from .NET 8 to .NET 6. That took me more than a week to discover that had happened. I have tried, multiple ways of getting Windows Authentication with IIS to work with a Blazor Server App and .NET 8. However, today I realized that is a broken dream. That I am wasting my time and need to give it up. Perhaps someday Microsoft will get around to bringing that back to a current version of .NET, but I need a solution today, not in November when .NET 9 comes out and hope that it brings Windows Authentication with Blazor Server, or some year in the future. This is very disappointing.

 

So, I think the only choice I have at this point, is to go back to ASP.NET Core with .NET 8. I have heard that it is possible to embed Blazor components into ASP.NET Core/Razor pages, so that is an option, I hope. That way I can have ASP.NET Core MVC do the Windows Authentication and use Blazor components here and there. But I don't know how to do that and trying to find some training on how to do that is difficult. I am asking for recommendations/guidance to training either on Microsoft Learn, Pluralsight, or YouTube so I can learn how to do this and move forward. Thank you very much in advance, for your help.

1 Reply

  • Shane_Gates's avatar
    Shane_Gates
    Copper Contributor

    It seems from the Blazor samples that this is possible but I haven't tried it myself:
    https://learn.microsoft.com/en-us/aspnet/core/blazor/security/blazor-web-app-with-windows-authentication?view=aspnetcore-9.0

Resources