【问题标题】:IIS / Windows AuthenticationIIS/Windows 身份验证
【发布时间】:2014-03-07 00:18:20
【问题描述】:

我有一个简单的 HTML 站点,我需要添加 Windows 身份验证,以便限制某些资源。

我目前在开发环境(本地计算机上的 IIS)中运行该站点,但我似乎无法获得所需的结果。

主站点需要打开......任何人都可以访问它。但是,某些 AD 安全组需要阻止子页面及其资源(可下载的 pdf 等)。

1) 使用下面的 web.config 文件 - 整个网站都要求进行身份验证(这不是我想要的),一旦我提供身份验证,我就不会被我提供的位置路径阻止。

2) 这个 web.config 不是我最终的样子,我只是在测试我是否可以在我真正投入真正的允许/拒绝逻辑之前阻止资源

这是我的简单 web.config 文件:

<configuration>
    <system.web>
        <authentication mode="windows" />
    </system.web>
    <location path="district/district.html">
        <system.web>
        <authorization>
            <deny users="*" />
        </authorization>
        </system.web>
    </location>
</configuration>

【问题讨论】:

    标签: iis web-config windows-authentication


    【解决方案1】:

    要使用 Windows 身份验证保护 IIS 7.5 中的单个页面或文档,只需执行以下步骤:

    1.   Open IIS 7 Manager.
    2.   Click on “Content View “at the bottom of the IIS 7 Manager and navigate to the file you want to password protect.
    3.   Right click on the target file and choose “Switch to Features View”.
    4.   Double click on Authentication under IIS Area.
    5.   Disable “Anonymous Authentication”.
    6.   And Enable “Windows Authentication”.
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-07-22
      • 2011-06-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多