簡體   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