![](/img/trans.png)
[英]HttpContext.Current.User.Identity.Name is empty with Form.authentication in subfolder of website in IIS
[英]MVC application authentication set to Windows. Httpcontext.current.user.identity.name empty string
场景:
IIS 6-匿名功能关闭,集成功能打开。
应用程序的Web配置 -身份验证设置为WINDOWS
用户网络计算机 -我们使用通用访问卡和大头针登录计算机
问题:
HttpContext.Current.User.Identity.Name始终为空。
有任何想法吗?
好! 这是答案。 在HttpContext对象中进行筛选后,我发现当前用户的Windows ID嵌套在LogonUserIdentity子对象中。
HttpContext.Current.Request.LogonUserIdentity.Name
为什么没有设置普通的HttpContext.User对象? 我不知道!
无论如何,问题解决了!
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.