Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Add the following to your root <code>web.config</code> for each folder you want to secure:</p> <pre><code>&lt;location path="secure_folder"&gt; &lt;system.webServer&gt; &lt;security&gt; &lt;authentication&gt; &lt;anonymousAuthentication enabled="false" /&gt; &lt;basicAuthentication enabled="true" /&gt; &lt;/authentication&gt; &lt;/security&gt; &lt;/system.webServer&gt; &lt;/location&gt; </code></pre> <p>The above assumes that you're using Basic Authentication.</p> <p>Alternatively create a <code>web.config</code> in each sub folder to be secured with pretty much the same (except without the <code>&lt;location&gt;</code> tag:</p> <pre><code>&lt;system.webServer&gt; &lt;security&gt; &lt;authentication&gt; &lt;anonymousAuthentication enabled="false" /&gt; &lt;basicAuthentication enabled="true" /&gt; &lt;/authentication&gt; &lt;/security&gt; &lt;/system.webServer&gt; </code></pre> <p>If receive an error such as:</p> <blockquote> <p>There was an error while performing this operation.</p> <p>Details: </p> <p>Filename: \?\d:\sites\play1\www\web.config</p> <p>Line number: 15</p> <p>Error: This configuration section cannot be used at this path. This happens when the section is locked at a parent level. Locking is either by default (overrideModeDefault="Deny"), or set explicitly by a location tag with overrideMode="Deny" or the legacy allowOverride="false".</p> </blockquote> <p>Then it means that the configuration settings for <code>&lt;anonymousAuthentication&gt;</code> and <code>&lt;basicAuthentication&gt;</code> haven't been delegated Read/Write permissions.</p> <p>You can adjust this by launching IIS Manager and opening the Feature Delegation manager:</p> <p><img src="https://i.stack.imgur.com/QsFX8.png" alt="enter image description here"></p> <p>When you do this you'll see a list of features that can be controlled and their delegation state:</p> <p><img src="https://i.stack.imgur.com/FKaHl.png" alt="enter image description here"></p> <p>Right click on <code>Authentication - Anonymous</code> and select <code>Read/Write</code>. Do the same for <code>Authentication - Basic</code>.</p> <p>This feature delegation setting will be applied globally across all sites on the server, however it is possible to fine tune this to specific sites using Custom Site Delegation.</p> <p>You can read more about IIS 7.x/8.0 Feature Delegation here:</p> <blockquote> <p><a href="http://www.iis.net/learn/manage/managing-your-configuration-settings/an-overview-of-feature-delegation-in-iis" rel="nofollow noreferrer">http://www.iis.net/learn/manage/managing-your-configuration-settings/an-overview-of-feature-delegation-in-iis</a></p> </blockquote>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload