【发布时间】:2014-12-10 11:19:28
【问题描述】:
我尝试使用 Windows 身份验证在 aspx 中创建身份验证系统。对于使用 Windows PC 的公司来说,这似乎是在 Intranet 中验证用户的默认模式。我在 IIS 中为我的站点启用了“Windows 身份验证”,并禁用了其他类型的身份验证。这是我的 Web.config 文件:
<system.web>
<authentication mode="Windows" />
<compilation debug="true" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
</system.web>
我所拥有的是我的代码中这一行提供的反馈(总是错误的)
Response.Write(User.Identity.IsAuthenticated.ToString());
我不确定我是否以正确的方式做所有事情,但我已经阅读了许多教程并且一切似乎都很简单......那么,我想做什么?我做错了什么?
我没有找到任何对我的实施有帮助的东西,只是我写的所有东西似乎什么都没做。呃,我也没有看到 Windows Auth Dialog
【问题讨论】:
-
试试
(WindowsIdentity)HttpContext.Current.User.Identity;看看它会返回什么
标签: c# asp.net windows authentication iis