允许对 web.config 中的单个文件夹进行匿名身份验证? [英] Allow anonymous authentication for a single folder in web.config?
问题描述
这里是场景,我有一个使用自定义身份验证的 Asp.Net 应用程序会员资格提供程序,但我们需要允许完全匿名访问(即)应用程序中的特定文件夹.
在 IIS 管理器中,您可以设置文件夹的身份验证模式,但设置保存在 C:WindowsSystem32inetsrvconfigapplicationHost.config
文件 如此处所述
为了使安装更容易,如果我能在 web.config 中设置它会很棒,但经过几次尝试后,我认为这可能是不可能的.
还有谁知道吗?
非常感谢
使用
配置标签,以及
> 只允许匿名或
所有:
So here is the scenario, I have an Asp.Net application that is using a custom authentication & membership provider but we need to allow completely anonymous access (i.e.) to a particular folder within the application.
In IIS manager, you can set the authentication mode of a folder, but the settings are saved within C:WindowsSystem32inetsrvconfigapplicationHost.config
file as described here
To make installation easier, it would be great if I could set this within my web.config but after a couple of attempts I think this may not be possible.
Does anyone know otherwise?
Many thanks
Use <location>
configuration tag, and <allow users="?"/>
to allow anonymous only or <allow users="*"/>
for all:
<configuration>
<location path="Path/To/Public/Folder">
<system.web>
<authorization>
<allow users="?"/>
</authorization>
</system.web>
</location>
</configuration>
这篇关于允许对 web.config 中的单个文件夹进行匿名身份验证?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!