【发布时间】:2011-03-08 09:14:47
【问题描述】:
该站点在我的本地 IIS 6.1 上运行。我想添加一些功能以从我们的 Active Directory (AD) 中提取信息。我的 AD 代码适用于许多其他项目和我的开发服务器。这是我写出用户名的尝试:
Response.Write("1. " + this.Request.LogonUserIdentity.Name);
Response.Write("2. " + Request.ServerVariables["Auth_User"]);
Response.Write("3. " + WindowsIdentity.GetCurrent().Name.ToString());
我得到的结果是:
- NT AUTHORITY\IUSR
- 管理员
- NT AUTHORITY\网络服务
我怎样才能获得像ourdomain/username这样的实际Windows用户名
【问题讨论】:
标签: c# asp.net authentication kentico