If all of the pages in your website is protected by Windows Authentication, use the configuration to enable public access to certain pages.
The idea is to protect the entire website and create an exception for the public page. Here are the steps:
- Enable Windows Authentication and disable Anonymous Authentication (This is how the Windows Authentication should be set - Anonymous Authentication should be disabled)
- In the web.config file, use location tag to allow Anonymous access to a certain page:
<configuration>
<system.web>
<authorization>
<allow users="*" />
<deny users="?" />
</authorization>
</system.web>
<location path="test”>
<system.webServer>
<security>
<authentication>
<anonymousAuthentication enabled="true" />
</authentication>
</security>
</system.webServer>
</location>
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
</system.webServer>
</configuration>
This configuration allows anonymous access to the test folder.
Set runAllManagedModulesForAllRequests
parameter to true
for making sure the managed modules process all requests.
The page may throw an error about not being able to override the authentication settings. If you run into this issue, go to applicationHost.config file and set overrideModeDefault
to Allow
.
Published Aug 07, 2020
Version 1.0Nedim
Former Employee
Joined November 26, 2018
IIS Support Blog
Follow this blog board to get notified when there's new activity