Posted on: 7/22/2013 4:30:04 PM | Views : 257

How can I get the users name before they are authenticated using windows authentication w/ anonymous authentication enabled.  I want to see who the user is before I try authenticate them.
//webconfig <authentication mode="Windows" /> <authorization> <allow users="?" /> </authorization> [Authorize] public ViewResult Index(string departmentURL) { var logger = LogManager.GetLogger("CompanyNews"); logger.Trace("index :" + System.Environment.UserName); logger.Trace("index :" + System.Security.Principal.WindowsIdentity.GetCurrent().Name); logger.Trace("index :" + System.Threading.Thread.CurrentPrincipal.Identity.Name); logger.Trace("index :" + User.Identity.Name); logger.Trace("end"); return View() } //results authenticated 07/22/2013 12:17:42: in ...

Go to the complete details ...