How to allow mixed-mode authentication in IIS 7.0

本秂侑毒 提交于 2019-12-21 17:04:29

问题


How do you back-door authenticate Windows users into a website using forms authentication running on IIS 7.0?


回答1:


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>


来源:https://stackoverflow.com/questions/3970427/how-to-allow-mixed-mode-authentication-in-iis-7-0

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!