无法让Windows和匿名身份验证协同工作

时间:2014-09-19 18:41:51

标签: c# asp.net authentication lifecycle

我之前的问题是我在页面加载期间无法找到Windows身份验证的用户ID。原因是因为我在IIS中打开了匿名和Windows身份验证。根据MMeasor的建议,当我关闭匿名身份验证时,它有效。

但我现在的问题是,我不能这样做。我的应用程序是CMS应用程序,任何人都可以访问它。只有两个特定文件夹的页面用于管理目的,需要Windows身份验证。目前我将我的IIS更改为仅具有Windows身份验证。但是如何让其他页面匿名但仍然对该文件夹进行Windows身份验证。

以下是我的web.Config详细信息:

<configuration>
    <location path="_FolderPath">
          <system.web>
             <authorization>
                <allow users="?"/>
             </authorization>
          </system.web>
       </location>
</configuration>

<system.web>
 <authentication mode="Windows" >
     <forms name=".ASPXAUTH" cookieless="UseCookies" />
     </authentication>
          <authorization>
           <allow users="*" />
        </authorization>
</system.web>

0 个答案:

没有答案