title: Windows Authentication allow users not working
body: <p>I am trying to use windows authentication for my application, for the testing I have tried allowing to only myself and deny all rest</p>
  
  <pre><code>&lt;authentication mode="Windows" /&gt;
  &lt;authorization&gt;
      &lt;allow users="DomainName\nogariyap" /&gt;
      &lt;deny users="*"/&gt;
  &lt;/authorization&gt;
  </code></pre>
  
  <p>But it gives me "<code>Access Denied</code>" error even I am logged in to my machine with the same user <code>"DomainName\nogariyap"</code></p>
  
  <p>When I change it to this</p>
  
  <pre><code>&lt;allow users="*" /&gt;
  </code></pre>
  
  <p>it works</p>
  
  <p>I don't know why it is not working for particular windows user?</p>
  
  <p><strong>Edit</strong></p>
  
  <p>It strangly worked when I added this in <code>system.webServer</code> </p>
  
  <pre><code>   &lt;security&gt;
          &lt;authentication&gt;
              &lt;windowsAuthentication enabled="true" /&gt;
              &lt;anonymousAuthentication enabled="false" /&gt;
          &lt;/authentication&gt;
          &lt;authorization&gt;
            &lt;remove users="*" roles="" verbs="" /&gt;
            &lt;add users="DomainName\nogariyap" accessType="Allow"/&gt;
            &lt;add users="?" accessType="Deny"/&gt;
          &lt;/authorization&gt;
      &lt;/security&gt;
  </code></pre>
  
  <p>But I don't know why it is not working with the settings in <code>system.web</code> and what are the difference in these two settings?</p>