我在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>