我想通过单点登录在asp.net中获取Windows登录用户名
我使用Global.asax Session_Start我尝试了WindowsIdentity.GetCurrent(); 它在本地工作,但在IIS中不工作。在本地DomainName // UserName中,但在IIS中IISAPPPOOL \ AppName
在IIS身份验证=>中启用了匿名身份验证,禁用了ASP.NET模拟,在更改它们的应用程序不起作用时,也禁用了表单身份验证。
My web config is like this
<authentication mode="Windows">
</authentication>
<authorization>
<deny users="?" />
</authorization>
<identity impersonate="true" />
Thread.CurrentPrincipal.Identity.Name; is null
HttpContext.Current.Request.LogonUserIdentity.Name; is IIS IISAPPPOOL\AppName
Context.User.Identity.Name; is null
System.Security.Principal.WindowsPrincipal p = System.Threading.Thread.CurrentPrincipal as System.Security.Principal.WindowsPrincipal; is null
HttpContext.Current.User.Identity.Name; is null
我该怎么解决
我解决了:)只是使用组策略首选项注册表配置IE可信站点http://deployhappiness.com/managing-internet-explorer-trusted-sites-with-group-policy/谢谢
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句