ApplicationContext does not have user Blazor Server #3008
Replies: 5 comments
-
This sounds like a bug, I'll have to look into this. Thank you for reporting! |
Beta Was this translation helpful? Give feedback.
-
@CProsRodneyWorkman I should confirm - this is with the data portal using |
Beta Was this translation helpful? Give feedback.
-
Here is my configuration. |
Beta Was this translation helpful? Give feedback.
-
Oh, looking at your config, I'm pretty sure the problem is that you haven't brought in the services necessary for aspnetcore or server-side Blazor: builder.Services.AddCsla(o => o
.AddAspNetCore()
.AddServerSideBlazor()
.DataPortal(dpo => dpo
.AddServerSideDataPortal()
.UseLocalProxy())); or really just this: builder.Services.AddCsla(o => o
.AddAspNetCore()
.AddServerSideBlazor()); because the data portal defaults to the configuration in that code. All the services necessary to properly manage the user principal in aspnetcore and server-side Blazor (which is an intricate process) are enabled by the |
Beta Was this translation helpful? Give feedback.
-
I added a new BlazorServerExample project to the repo that demostrates the basics. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Describe the bug
I have a service that calls Portal Create and it found an authenticated user from the HttpContextAccessor moments later the BusinessBase Create method ApplicationContext does not have a user.
Version and Platform
Csla.Blazor 6.0.0
OS: Windows, Linux, iOS, Android, etc.
Platform: Blazor Server Side
Code that Fails
Stack Trace or Exception Detail
Provide a stack trace, or at least detailed information about the exception.
Additional context
In my Login.cshtml.cs I set the Principal
await HttpContext.SignInAsync(
CookieAuthenticationDefaults.AuthenticationScheme,
principal,
authProperties);
Program.zip
Beta Was this translation helpful? Give feedback.
All reactions