C
C#8mo 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?
0 Replies
No replies yetBe the first to reply to this messageJoin