Chris Fewtrell Chris Fewtrell - 1 year ago 335
ASP.NET (C#) Question

Allow anonymous authentication for a single folder in 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

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

Answer Source

Use <location> configuration tag, and <allow users="?"/> to allow anonymous only or <allow users="*"/> for all:

   <location path="Path/To/Public/Folder">
            <allow users="?"/>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download