protected void Session_Start(object sender, EventArgs e) { // mostly for windows auth if ((Request.LogonUserIdentity == null || !Request.IsAuthenticated) && string.IsNullOrEmpty(ConfigurationManager.AppSettings["impersonateUser"])) return; var userName = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["impersonateUser"]) ? ConfigurationManager.AppSettings["impersonateUser"] : Request.LogonUserIdentity.Name; // go get the user record from a service, AD, database, etc. var user = new ThirdCorner.Base.Models.User { UserId = 1, UserName = userName, FullName = "Sean Goodpasture", IsAdmin = true }; // put it in the session HttpContext.Current.Session[LoggedInUser.SESSION_KEY] = user; }
protected void Session_Start(object sender, EventArgs e) { // mostly for windows auth if ((Request.LogonUserIdentity == null || !Request.IsAuthenticated) && string.IsNullOrEmpty(ConfigurationManager.AppSettings["impersonateUser"])) { return; } var userName = !string.IsNullOrEmpty(ConfigurationManager.AppSettings["impersonateUser"]) ? ConfigurationManager.AppSettings["impersonateUser"] : Request.LogonUserIdentity.Name; // go get the user record from a service, AD, database, etc. var user = new ThirdCorner.Base.Models.User { UserId = 1, UserName = userName, FullName = "Sean Goodpasture", IsAdmin = true }; // put it in the session HttpContext.Current.Session[LoggedInUser.SESSION_KEY] = user; }