© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago
aquaritek

.Net 8 Blazor Web App Identity Framework Help

Super quick overview:

I have a Blazor Web App that is single process only hosting UI.
It communicates with a .Net Web Api for all backend services including Authentication.
Api side I have my own Identity Controller that's a mix of old and new endpoints for Identity (Doesn't really matter here because the end result is a properly issued token and that works fine).
Client side I have a customized workflow and implementation of AuthenticationStateProvider to satiate ClaimsPrinciples.

Here's the damn problem. In .Net 7 you could completely opt out of "Authentication" on the Blazor side and only use "Authorization" with .AddAuthorizationCore() then use a custom Auth workflow and AuthenticationStateProvider like I am. Decorate pages with @attribute [Authorize] and bobs your uncle the AuthenticationStateProvider would be invoked to check for a Principle.

In a .Net 8 Web App no matter what I do and this has been since yesterday. I'm being forced to utilize some sort of Authentication on the blazor side to utilize the [Authorize] attribute. It's driving me banana's because my whole Authentication workflow including Hyrdration of ClaimsPrinciple for that StateProvider is fully custom because of the Web Api.

Just for a little more detail the actual error that I get is:

InvalidOperationException: Unable to find the required 'IAuthenticationService' service. Please add all the required services by calling 'IServiceCollection.AddAuthentication' in the application startup code.

Do anyone have any thoughts here?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements

Similar Threads

Blazor Web App (.NET 8) - Logout functionality with IdentityCore
C#CC# / help
3y ago
Identity .NET 8
C#CC# / help
2y ago
.NET 8 SPA Identity
C#CC# / help
2y ago
✅ Configuring .NET 8 Identity
C#CC# / help
2y ago