Access denied for login page even though i set the tag location in web.config file

261 Views Asked by At

I have a problem with form authentication from IIS. The problem is that i can't access the login.html file, even though a put the tag location in my web.config file. I use only form authentication. Here is my config file:

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

There are 0 best solutions below