繁体   English   中英

ASP.NET Windows身份验证在IIS 7.5中不起作用

[英]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上。

  • Windows身份验证已安装并启用
  • 目标框架是4.0
  • 应用程序池管道事物集成
  • Windows身份验证中的扩展保护为“关闭”和“接受”(均尝试)

将授权部分更改为:

<authorization>
  <deny users="?"/>
</authorization>

我认为通过说allow users="*"您允许所有人访问。

参见Scott Guthrie的这篇文章

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM