Set up a public page in Windows Authentication protected website
Published Aug 07 2020 04:12 PM 3,758 Views

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:



            <allow users="*" />
            <deny users="?" />

<location path="test”>
                <anonymousAuthentication enabled="true" />

     <modules runAllManagedModulesForAllRequests="true" />



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.

Version history
Last update:
‎Aug 07 2020 04:12 PM
Updated by: