Example of using Client Side Blazor with Identity and CSLA #1956
Replies: 1 comment 6 replies
-
I do have a server-side Blazor project that uses the aspnet user database concept. I don't have a client-side Blazor project that does this. I think the important thing is to understand the purpose of the AuthenticationStateProvider and user service. Blazor doesn't rely on the thread's CurrentPrincipal or HttpContext to maintain the user's identity. Instead, they externalized that concept to your The At the end of the day, CSLA itself relies on |
Beta Was this translation helpful? Give feedback.
-
I'm wondering if someone could provide an example of how to connect up the client side CslaUserService with the ClaimsPrincipal using .NET Core Identity. I've seen the client side authentication example in the Blazor book as well as the ProjectTracker application where the Login page is on the client, it uses the dataportal to call the data access layer to get the user and role info, and then takes that info and generates the ClaimsPrincipal on the client side and assign it to the UserService.
I was also looking at what the Client Side Blazor template does when you add authentication when creating the solution. It generates the login page on the app server (similar to server side Blazor) and will use the SignInManager of the Identity framework to perform the login.
What I can't wrap my head around is how I could utilize the Identity Framework on the server to send that ClaimsPrincipal back to the client if I were to utilize the template's server side login functionality. I'd like to take advantage of some of the built in functionality of Identity (like Lockout and 2FA) rather than rolling my own by building upon the ProjectTracker example.
Any help would be greatly appreciated. Thanks.
Beta Was this translation helpful? Give feedback.
All reactions