Our application requires Active Directory for users to access it. Our goal is to split the business logic and the security.
Here is what I try to do but did not succeed yet :
- Connect to Active Directory via开发者_C百科 - web.config.
- Specify groups needed for each - .aspxpage in the web.config file. (e.g.:- index.aspx = admin, users)
- Redirect the user to an error page if user's groups do not match the expected credentials. 
- Do all this without adding any code in my actual pages (to split business logic from security). 
What do you suggest for that ? I found many examples on the web about Active Directory but they were not doing what I wanted.
Have you tried something like this in your web.config file.
<configuration>    
    <system.web>
        <authentication mode="Windows"/>
        <authorization>
         <allow roles="AD\My-Security-Group"/>
         <deny users="?"/>
        </authorization>
        <identity impersonate="true"/>
    </system.web>
    <location path="/ProtectedPath">
        <system.web>
          <authorization>
            <deny roles="AD\My-Security-Group"/>
            <allow roles="AD\My-Other-Security-Group"/>
          </authorization>
        </system.web>
    </location>
</configuration>
 
         
                                         
                                         
                                         
                                        ![Interactive visualization of a graph in python [closed]](https://www.devze.com/res/2023/04-10/09/92d32fe8c0d22fb96bd6f6e8b7d1f457.gif) 
                                         
                                         
                                         
                                         加载中,请稍侯......
 加载中,请稍侯......
      
精彩评论