Allow allow AD Group access

让人想犯罪 __ 提交于 2020-01-24 13:05:06

问题


I have an ASP.NET website and I would like to only allow users in an AD group access to the site. I am using a web.config snippet as below, but this does not seem to work:

<authorization>
        <deny users="*" />
             <add accessType="Allow" roles="DOMAIN\GroupTest" />

        </authorization>

Any advice how to implement this is much appreciated!


回答1:


You need to change your configuration as follows:

<configuration>
  <system.web>
    <!-- ... -->
    <authorization>
      <allow roles="DOMAIN\GroupTest" />
      <deny users="*" />
    </authorization>
    <!-- ... -->
  </system.web>
</configuration>

As described in this article, ASP.NET looks for a matching allow or deny rule when granting access. If a matching allow rule is encountered first, access is granted.



来源:https://stackoverflow.com/questions/34069415/allow-allow-ad-group-access

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!