title: IIS7 Authorization Rules / Config - Prompting Perpetually
body: <p>I am trying to secure an application in IIS7 using .NET Authorization Rules.</p>
  
  <p>By default, the web server allows all users access (which is inherited).</p>
  
  <p>I have added, just for this one application directory, a deny all users command, as well as an allow command for specific users.</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;configuration&gt;
      &lt;system.web&gt;
          &lt;authorization&gt;
              &lt;allow users="myusername" /&gt;
              &lt;deny users="*" /&gt;
          &lt;/authorization&gt;
      &lt;/system.web&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I have Windows Authentication enabled, and I can verify that without the  line that my REMOTE_USER is MYDOMAIN\myusername. </p>
  
  <p>However, when I try to deny all users, I am prompted with the typical Windows domain username/password box. If I enter the username password, the prompt comes back up again 3 times until finally presenting me with a failure message. (I have also tried  to no avail)</p>
  
  <p>Looking in the event viewer, it appears as if my login using the username and pw is successful in the audit ... and to further that point, my account is not being locked out (which it would if I were failing to login over and over). So it's as if I am logging in, but the configuration is not seeing what I entered as matching my login.</p>
  
  <p>Below is the message I see (even when connecting from the server using localhost):</p>
  
  <p>**Access is denied.</p>
  
  <p>Description: An error occurred while accessing the resources required to serve this request. The server may not be configured for access to the requested URL. </p>
  
  <p>Error message 401.2.: Unauthorized: Logon failed due to server configuration.  Verify that you have permission to view this directory or page based on the credentials you supplied and the authentication methods enabled on the Web server.  Contact the Web server's administrator for additional assistance.**</p>