即使我在web.config文件

时间:2018-01-04 13:12:15

标签: iis web-config form-authentication

我在IIS中遇到表单身份验证问题。问题是我无法访问login.html文件,即使将标记位置放在我的web.config文件中也是如此。我只使用表单身份验证。 这是我的配置文件:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
<appSettings>
    <add key="autoFormsAuthentication" value="false" />
    <add key="enableSimpleMembership" value="false"/>
  </appSettings>
  <system.web>
   <authentication mode="Forms">
      <forms loginUrl="login.html" name="formsauth1" timeout="60" defaultUrl="index.html">
         <credentials passwordFormat="Clear">
            <user name="username" password="pass" />
         </credentials>
      </forms>
   </authentication>
 </system.web>
 <system.webServer>
    <modules>
        <remove name="FormsAuthentication" />
        <remove name="DefaultAuthentication" />
        <add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" preCondition="" />
        <add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="" />
    </modules>
  </system.webServer>
  <location path="login.html"> 
    <system.web>
        <authorization>
            <allow users="*" /> 
        </authorization>
    </system.web>
  </location>

</configuration>

0 个答案:

没有答案