![](/img/trans.png)
[英]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.