title: IIS Express HTTP Error 401.2 - Unauthorized
body: <p>I have tried the suggestions in <a href="https://stackoverflow.com/questions/4762538/iis-express-windows-authentication">this post</a> but I can not get Windows Authentication working with IIS Express in Vision Studio 2010. Now I get following error:
  <img src="https://i.stack.imgur.com/fJDnX.png" alt="401.2 Error"></p>
  
  <p>Here are my applicationhost.config file entries:</p>
  
  <pre><code>...
  &lt;add name="WindowsAuthenticationModule" lockItem="false" /&gt;
  ...
  &lt;authentication&gt;
  
      &lt;anonymousAuthentication enabled="true" userName="" /&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;/authentication&gt;
  ...
  &lt;sectionGroup name="authentication"&gt;
      &lt;section name="anonymousAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="basicAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="clientCertificateMappingAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="digestAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="windowsAuthentication" overrideModeDefault="Allow" /&gt;
  &lt;/sectionGroup&gt;
  </code></pre>
  
  <p>My web.config:</p>
  
  <pre><code>&lt;system.web&gt;
      &lt;authentication mode="Windows" /&gt; 
  &lt;/system.web&gt;
  &lt;system.webServer&gt;
      &lt;security&gt;
          &lt;authentication&gt;
              &lt;anonymousAuthentication enabled="false" /&gt;
              &lt;windowsAuthentication enabled="true" /&gt;        
          &lt;/authentication&gt;
      &lt;/security&gt;
  &lt;/system.webServer&gt;
  </code></pre>
  
  <p>This is .NET 4</p>