Wrong authentication after changing user's logon name

倾然丶 夕夏残阳落幕 提交于 2019-12-10 00:53:21

问题


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.57.1.64 GET /eft/Default.aspx - 80 - 10.57.0.161 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+Trident/4.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+.NET4.0C;+.NET4.0E) 401 2 2148074254

2011-04-05 11:41:44 W3SVC1 MARS 10.57.1.64 GET /eft/Default.aspx - 80 SANOMABP\new.name 10.57.0.161 Mozilla/4.0+(compatible;+MSIE+7.0;+Windows+NT+5.2;+Trident/4.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727;+.NET+CLR+3.0.4506.2152;+.NET+CLR+3.5.30729;+.NET4.0C;+.NET4.0E) 200 0 0

We have restarted the application pool, we have checked the AD data, and we have no more ideas what could be wrong.


回答1:


MOVING CORRECT ANSWER FROM COMMENTS FOR CLARITY:

@paolo: you may try looking at support.microsoft.com/kb/946358



来源:https://stackoverflow.com/questions/5551489/wrong-authentication-after-changing-users-logon-name

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!