如何在IIS 7.0中允许混合模式身份验证

问题描述:

如何使用在IIS 7.0上运行的表单身份验证将Windows用户验证到网站中?如何在IIS 7.0中允许混合模式身份验证

创建一个单独的页面来处理Windows登录。此页面将验证用户,然后为他们设置Forms 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>