【发布时间】:2017-02-13 20:47:40
【问题描述】:
Web.Config windows 身份验证显示空用户名
我的 WebConfig 身份验证已启用
C# 代码 我试过了
WindowsIdentity.GetCurrent(); // showing null
System.Security.Principal.WindowsIdentity.GetCurrent().Name // showing null
System.Security.Principal.WindowsIdentity.GetCurrent().Name;// showing null
Request.ServerVariables["LOGON_USER"] // showing null
Request.ServerVariables["REMOTE_USER"] // showing null
【问题讨论】:
-
您是否使用 IISExpress 托管此内容?您是否关闭了匿名身份验证。
-
是托管在 IIS 上并且匿名身份验证已关闭
标签: asp.net-mvc c#-4.0 windows-authentication