允许匿名身份验证在web.config中一个文件夹? [英] Allow anonymous authentication for a single folder in web.config?
问题描述
所以这里的情景,我有一个使用自定义身份验证和放一个Asp.Net应用;成员资格提供程序,但我们需要让应用程序内完全匿名访问(即)到特定的文件夹中。
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.
在IIS管理器中,可以设置文件夹的身份验证模式,但设置保存在 C:\\ WINDOWS \\ SYSTEM32 \\ INETSRV \\设置\\的applicationHost.config
文件<一个href=\"http://stackoverflow.com/questions/1645562/using-anonymous-and-basic-authentication-in-the-same-folder-under-iis7\" 作为这个问题的描述>这里描述标题=
In IIS manager, you can set the authentication mode of a folder, but the settings are saved within C:\Windows\System32\inetsrv\config\applicationHost.config
file as described here
要便于安装,这将是巨大的,如果我能我的web.config中,但一对夫妇的尝试,我认为这是不可能的后置这一点。
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.
有谁知道这样呢?
非常感谢
推荐答案
使用&LT;地点&gt;
配置标记和&LT;让用户= /&GT;
允许匿名仅或&LT;让用户=*/&GT;
所有?
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屋!