如何为某些网页应用表单身份验证

Ari*_*ian 0 c# asp.net web-config active-directory form-authentication

请考虑这种情况:

我有一个项目,它包含一些网页Active Direcotry.我为我的所有网页添加表单身份验证.例如:

<connectionStrings>
   <add name="ADConnectionString" connectionString="LDAP://testdomain.test.com/CN=Users,DC=testdomain,DC=test,DC=com" />
</connectionStrings>
<authorization>
     <deny users="?" />      
</authorization>
Run Code Online (Sandbox Code Playgroud)

现在我想从表单身份验证中排除一些页面.web.config如何排除某些页面?

谢谢

Ram*_*ran 5

将您的页面放在一个单独的目录中并相应地修改web.config.您也可以这样做

    <configuration>
       <location path="CreateAccount.aspx">
        <system.web>
         <authorization>
          <allow users="?"/>
         <authorization>
        </system.web>
      </location>  
   </configuration>
Run Code Online (Sandbox Code Playgroud)

更多讨论

链接1

从表单auth中排除页面 - ASP.NET