One thing that's always confused me is why do I need to always write code like this...
protected void Application_AuthenticateRequest(object sender, EventArgs e)
{
if (HttpContext.Current.User != null && HttpContext.Current.User.Identity.IsAuthenticated)
{
if (HttpContext.Current.User.Identity.GetType() == typeof (FormsIdentity))
{
var fi = (FormsIdentity) HttpContext.Current.User.Identity;
FormsAuthenticationTicket fat = fi.Ticket;
var roles = fat.UserData.Split(',');
HttpContext.Current.User = new GenericPrincipal(new FormsIdentity(fat), roles);
}
}
return;
}
Why can't the framework do thi ...
Go to the complete details ...