2014-03-04 240 views
0

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

我目前有一个开发环境(本地机器上的IIS)运行的网站,我似乎无法实现我需要的结果。

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

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

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> 

回答

1

为了确保单页或文档在IIS 7.5与Windows身份验证只需按照下列步骤操作:

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”.