Wrong authentication after changing user's logon name
We have a user who recently changed name. Let's say the old username was old.name and the new username is new.name. After editing the details in AD and logout/login with the new user name, our ASP.NET application shows the old name. Plain ASP.NET, no MVC, using Windows authentication. The code for getting the user name is: WindowsPrincipal wp = (WindowsPrincipal)HttpContext.Current.User; String userName = wp.Identity.Name.Substring(wp.Identity.Name.IndexOf("\\") + 1); This returns old.name, not new.name. I checked the IIS log files, these show the new name: 2011-04-05 11:41:44 W3SVC1 MARS 10