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

时间:2011-11-08 22:48:44

标签: asp.net windows iis authentication

所以我有一个使用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身份验证中的扩展保护是“关闭”和“接受”(同时尝试)

1 个答案:

答案 0 :(得分:3)

将授权部分更改为:

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

我认为通过说allow users="*"你允许每个人进入。

Scott Guthrie

查看此帖
相关问题