BlazorServerExample RevalidatingIdentityAuthenticationStateProvider #3099
Replies: 1 comment 2 replies
-
The Blazor 2019 book is pretty outdated due to changes to how Blazor works between then and now. The I'd recommend using the Microsoft project template that is closest to the authentication model you want to use as a starting point. Their templates provide implementations for the "identity user" and "authentication state provider" types to meet the needs of oath, aad, or whatever. The only thing CSLA 6 relies on at this point is a |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm migrating a solution from Blazor Wasm to Blazor Server due to extremely poor performance for some intense calculations (20x slower).
It's a bit disappointing that authentication on the server has to occur outside the Blazor framework, requiring old-school Razor Pages. I've been going through the
BlazorServerExample
and Using CSLA 5 Blazor and WebAssembly book. I'm not usingASP.NET Core Identity
and it looks like theBlazorServerExample
isn't really either. The authentication works fine with the following commented out:With those lines still included, when
ValidateAuthenticationStateAsync
triggers:System.InvalidOperationException: No service for type Microsoft.AspNetCore.Identity.IdentityUser has been registered.
I suppose my question is, should I be implementing a
RevalidatingServerAuthenticationStateProvider
? However, I don't fully understand the purpose, or how to do it properly with a simple table in a database storing user names and password hashes.Beta Was this translation helpful? Give feedback.
All reactions