Open coding786 opened 5 years ago
can you reply on this ?
ApplicationContext
relies on providers to work correctly in different runtime environments.
The default provider for legacy ASP.NET uses HttpContext.Current.User
.
The ASP.NET Core default provider uses HttpContext?.User
. So as long as there is an HttpContext
object available the CSLA User
property simply returns the value from HttpContext
.
This does require that your web project has referenced the CSLA-ASPNETCORE package.
As per the books, if windows authentication is enabled on Dataportal Server side, custom code needs to be written(on the specific platform) to assign Csla.ApplicationContext.User with the running prinicpal as csla will not fill in any principal to Csla.ApplicationContext.User. Is it correct ?
If above is correct, it means in context of asp.net core, we will need to assign Httpcontext.User to Csla.ApplicationContext.User. As my portal is windows authentication enabled on IIS, i think below code will work here, pls confirm,
Startup.cs :
services.Configure(options =>
{
options.AutomaticAuthentication = true;
});
Csla.ApplicationContext.User = some code to get HTTPContext.User;
Version and Platform CSLA version: 4.9 OS: Windows Platform: WinForms, WPF, ASP.NET Core