首页 文章

ASP.NET IIS6:通过web.config中的授权部分将用户列入白名单

提问于
浏览
2

考虑一个网站下的IIS6应用程序:

  • 启用Windows身份验证 .

  • 匿名关闭

这是一个带有Areas的ASP.NET MVC应用程序 . 根web.config具有身份验证和授权节点,如下所示:

<authentication mode="Windows"></authentication>

<authorization> 
    <allow users="domain\abc, domain\xyz, domain\foo, domain\bar"/>   
</authorization>

我的身份不在允许的用户列表中 . 在浏览器中输入URL,我可以查看并导航到其中的所有页面 . 我知道我正在被授权,因为我的Active Directory名称显示在网站上 .

Problem: 我可以访问该网站 .

Question: 使用web.config,如何根据用户的Windows凭据将用户限制为此IIS6应用程序?

2 回答

  • 4

    如何在允许之后添加拒绝部分?

    <deny users="*" />
    
  • 2

    试试这个:

    <authorization> 
        <allow users="domain\abc, domain\xyz, domain\foo, domain\bar"/>   
        <deny users="*"/>
    </authorization>
    

相关问题