[英]why does windows authentication / impersonation fail on asp.net application with iis 7.5 / windows 7 /
[英]ASP.NET Windows Authentication not working in IIS 7.5
因此,我有一个使用Windows身份验证的ASP.NET站点,它仅做一件事:
protected void Page_Load(object sender, EventArgs e)
{
somelabel.Text = HttpContext.Current.User.Identity.IsAuthenticated.ToString();
return;
}
不幸的是,由于某种原因,它总是错误的。 这是我的web.config
<configuration>
<system.web>
<compilation debug="true" targetFramework="4.0"/>
<authentication mode="Windows"/>
<authorization>
<allow users="*"/>
</authorization>
<customErrors mode="Off"/>
<pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
</system.web>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true"/>
</system.webServer>
</configuration>
我将其部署在运行IIS 7.5的Windows 7上。
将授权部分更改为:
<authorization>
<deny users="?"/>
</authorization>
我认为通过说allow users="*"
您允许所有人访问。
参见Scott Guthrie的这篇文章
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.