开发者

How to allow mixed-mode authentication in IIS 7.0

开发者 https://www.devze.com 2023-01-20 16:28 出处:网络
How do you back-door authenticate Windows users into a website using forms authe开发者_Go百科ntication running on IIS 7.0?Create a separate page to handle windows logins. This page will authenticate t

How do you back-door authenticate Windows users into a website using forms authe开发者_Go百科ntication running on IIS 7.0?


Create a separate page to handle windows logins. This page will authenticate the user and then set the Forms cookie for them. Then, add the page to the web.config to tell IIS 7 to use Windows authentication on that particular page.

<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>
0

精彩评论

暂无评论...
验证码 换一张
取 消