创建一个单独的页面来处理Windows登录。此页面将对用户进行身份验证,然后为其设置表单cookie。然后,将该页添加到web.config中,告诉IIS 7在该特定页上使用Windows身份验证。
<configuration>
...
<!-- this file captures the user and redirects to the login page -->
<location path="Account/WindowsLogin.aspx">
<system.web>
<authorization>
<allow users="*" />
</authorization>
</system.web>
<system.webServer>
<security>
<authentication>
<windowsAuthentication enabled="true" />
<anonymousAuthentication enabled="false" />
</authentication>
</security>
</system.webServer>
</location>
</configuration>