I am developing a POC for a customer using the following technologies.
I have been running into some issues with the Csla.ApplicationContext.User not holding my Custom principal object. When a user has logged in, it reverts back to the regular principal object when I enter any controller context. Here is the relevant code:
In my global.asax.cs
protected void Application_AuthenticateRequest(Object sender, EventArgs e)
{
//if (Csla.ApplicationContext.User != null &&
// Csla.ApplicationContext.User.Identity.IsAuthenticated &&
// Csla.ApplicationContext.User.Identity is FormsIdentity)
HttpCookie authCookie = Request.Cookies[FormsAuthentication.FormsCookieName];
if (authCookie != null)
{
FormsAuthenticationTicket ticket = FormsAuthentication.Decrypt(authCookie.Value);
if (ticket != null && ticket.Name != string.Empty)
CslaPoc.Library.Security.RmsPrincipal.Load(ticket.Name);
}
}
Copyright (c) Marimer LLC