title: Using Windows Authentication in ASP.NET
body: <p>I'm trying to use Windows Authentication in my ASP.NET application. Whenever I try to view the app it sends me to a login page. How can I make it work without having to manually login via the browser?</p>
  
  <h3>web.config</h3>
  
  <pre><code>  &lt;system.web&gt;
      &lt;authentication mode="Windows"&gt;&lt;/authentication&gt;
      &lt;anonymousIdentification enabled="false"/&gt;
      &lt;authorization&gt;
        &lt;deny users="?" /&gt;
        &lt;allow users="*" /&gt;
      &lt;/authorization&gt;
      &lt;customErrors mode="Off"&gt;&lt;/customErrors&gt;
      &lt;identity impersonate="true"&gt;&lt;/identity&gt;
      &lt;compilation debug="true" targetFramework="4.0" /&gt;
      &lt;httpRuntime /&gt;
    &lt;/system.web&gt;
  </code></pre>
  
  <h3>error after updating IIS Express</h3>
  
  <pre><code>Most likely causes:
  No authentication protocol (including anonymous) is selected in IIS.
  Only integrated authentication is enabled, and a client browser was used that does not support integrated authentication.
  Integrated authentication is enabled and the request was sent through a proxy that changed the authentication headers before they reach the Web server.
  The Web server is not configured for anonymous access and a required authorization header was not received.
  The "configuration/system.webServer/authorization" configuration section may be explicitly denying the user access.
  </code></pre>
  
  <h3>applicationhost.config</h3>
  
  <pre><code>&lt;authentication&gt;
    &lt;anonymousAuthentication enabled="false" /&gt;
    &lt;basicAuthentication enabled="false" /&gt;
    &lt;clientCertificateMappingAuthentication enabled="false" /&gt;
    &lt;digestAuthentication enabled="false" /&gt;
    &lt;iisClientCertificateMappingAuthentication enabled="false"&gt;
    &lt;/iisClientCertificateMappingAuthentication&gt;
  
    &lt;windowsAuthentication enabled="true"&gt;
      &lt;providers&gt;
        &lt;add value="Negotiate" /&gt;
        &lt;add value="NTLM" /&gt;
      &lt;/providers&gt;
    &lt;/windowsAuthentication&gt;
  &lt;/authentication&gt;
  </code></pre>