title: HTTP Error 500.19 - Error Code 0x80070021
body: <p><strong>Background:</strong> Trying to debug WebForms application and get authenticated windows user from AD, </p>
  
  <p>On F5 I get greeted with this amazing page.</p>
  
  <p><strong>Module</strong>
     WindowsAuthenticationModule </p>
  
  <p><strong>Notification</strong>
     AuthenticateRequest </p>
  
  <p><strong>Handler</strong>
     ExtensionlessUrl-Integrated-4.0 </p>
  
  <p><strong>Error Code</strong>
     0x80070021 </p>
  
  <p><strong>Config Error</strong>
     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>
  
  <p><a href="https://i.stack.imgur.com/f33Jo.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/f33Jo.png" alt="onDebug"></a></p>
  
  <p><strong>Config Source:</strong></p>
  
  <pre><code>   81:         &lt;anonymousAuthentication enabled="false"/&gt;
     82:         &lt;windowsAuthentication enabled="true"/&gt;
     83:         &lt;basicAuthentication enabled="false"
  </code></pre>
  
  <p>My Web.config(JustDifferentNames)</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;!--
    For more information on how to configure your ASP.NET application, please visit
    http://go.microsoft.com/fwlink/?LinkId=169433
    --&gt;
  &lt;configuration&gt;
    &lt;configSections&gt;
      &lt;!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --&gt;
      &lt;section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/&gt;
      &lt;!--&lt;section name="windowsAuthentication" overrideModeDefault="Allow" /&gt;
      &lt;section name="anonymousAuthentication" overrideModeDefault="false" /&gt;
      &lt;add name="WindowsAuthenticationModule" lockItem="false" /&gt;
      &lt;add name="AnonymousAuthenticationModule" lockItem="false" /&gt;--&gt;
    &lt;/configSections&gt;
      &lt;connectionStrings&gt;
      &lt;!--&lt;add name="MyContext" connectionString="Data Source=idea-pc;Initial Catalog=componentnameNumber;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;--&gt;
      &lt;add name="DBComponent1" connectionString="Data Source=idea-pc;Initial Catalog=comp2;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
      &lt;add name="DBComponent2" connectionString="Data Source=idea-pc;Initial Catalog=comp3;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
      &lt;add name="DBComponent3" connectionString="Data Source=idea-pc;Initial Catalog=comp4;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
      &lt;add name="DBComponent4" connectionString="Data Source=idea-pc;Initial Catalog=comp5;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
      &lt;add name="DefaultConnection" connectionString="Data Source=(LocalDb)\MSSQLLocalDB;AttachDbFilename=|DataDirectory|\aspnet-MyProj-20160209113257.mdf;Initial Catalog=aspnet-MyProjectEvents-20160209113257;Integrated Security=True" providerName="System.Data.SqlClient"/&gt;
    &lt;/connectionStrings&gt;
    &lt;system.web&gt;
          &lt;authentication mode="Windows"/&gt;
          &lt;identity impersonate="false"/&gt;
          &lt;authorization&gt;
             &lt;allow users="*"/&gt;
          &lt;/authorization&gt;
          &lt;compilation debug="true" strict="false" explicit="true" targetFramework="4.5"/&gt;
          &lt;customErrors mode="Off"/&gt;
      &lt;!--&lt;/system.web&gt;--&gt;
      &lt;pages&gt;
        &lt;namespaces&gt;
          &lt;add namespace="System.Web.Optimization"/&gt;
          &lt;add namespace="Microsoft.AspNet.Identity"/&gt;
        &lt;/namespaces&gt;
        &lt;controls&gt;
          &lt;add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/&gt;
          &lt;add tagPrefix="ajaxToolkit" assembly="AjaxControlToolkit" namespace="AjaxControlToolkit"/&gt;
        &lt;/controls&gt;
      &lt;/pages&gt;
      &lt;membership&gt;
        &lt;providers&gt;
          &lt;!--
          ASP.NET Membership is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
          --&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/membership&gt;
      &lt;profile&gt;
        &lt;providers&gt;
          &lt;!--
          ASP.NET Membership Profile is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
          --&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/profile&gt;
      &lt;roleManager&gt;
        &lt;!--
            ASP.NET Membership Role is disabled in this template. Please visit the following link http://go.microsoft.com/fwlink/?LinkId=301889 to learn about the ASP.NET Membership support in this template
          --&gt;
        &lt;providers&gt;
          &lt;clear/&gt;
        &lt;/providers&gt;
      &lt;/roleManager&gt;
      &lt;!--
              If you are deploying to a cloud environment that has multiple web server instances,
              you should change session state mode from "InProc" to "Custom". In addition,
              change the connection string named "DefaultConnection" to connect to an instance
              of SQL Server (including SQL Azure and SQL  Compact) instead of to SQL Server Express.
        --&gt;
      &lt;sessionState mode="InProc" cookieless="false" timeout="30" customProvider="DefaultSessionProvider"&gt;
        &lt;providers&gt;
          &lt;add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/&gt;
        &lt;/providers&gt;
      &lt;/sessionState&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;basicAuthentication enabled="false"
                               realm=""
                               defaultLogonDomain="TestDomain"/&gt;
        &lt;/authentication&gt;
      &lt;/security&gt;
  
  
  
      &lt;modules&gt;
        &lt;!--&lt;remove name="FormsAuthentication"/&gt;--&gt;
      &lt;/modules&gt;
    &lt;/system.webServer&gt;
    &lt;runtime&gt;
      &lt;gcAllowVeryLargeObjects enabled="true" /&gt;
      &lt;assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Newtonsoft.Json" culture="neutral" publicKeyToken="30ad4fe6b2a6aeed"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="WebGrease" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-1.5.2.14234" newVersion="1.5.2.14234"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.OAuth" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security.Cookies" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/&gt;
        &lt;/dependentAssembly&gt;
        &lt;dependentAssembly&gt;
          &lt;assemblyIdentity name="Microsoft.Owin.Security" culture="neutral" publicKeyToken="31bf3856ad364e35"/&gt;
          &lt;bindingRedirect oldVersion="0.0.0.0-3.0.1.0" newVersion="3.0.1.0"/&gt;
        &lt;/dependentAssembly&gt;
      &lt;/assemblyBinding&gt;
    &lt;/runtime&gt;
    &lt;entityFramework&gt;
      &lt;defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework"&gt;
        &lt;parameters&gt;
          &lt;parameter value="mssqllocaldb"/&gt;
        &lt;/parameters&gt;
      &lt;/defaultConnectionFactory&gt;
      &lt;providers&gt;
        &lt;provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer"/&gt;
      &lt;/providers&gt;
    &lt;/entityFramework&gt;
    &lt;system.codedom&gt;
      &lt;compilers&gt;
        &lt;compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:6 /nowarn:1659;1699;1701"/&gt;
        &lt;compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.CodeDom.Providers.DotNetCompilerPlatform.VBCodeProvider, Microsoft.CodeDom.Providers.DotNetCompilerPlatform, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" warningLevel="4" compilerOptions="/langversion:14 /nowarn:41008 /define:_MYTYPE=\&amp;quot;Web\&amp;quot; /optionInfer+"/&gt;
      &lt;/compilers&gt;
    &lt;/system.codedom&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Looked around checked my settings and I found that I dont have Win Auth under my
   IIS -> World Wide Web Services -> Security</p>
  
  <p><a href="https://i.stack.imgur.com/A0SK3.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/A0SK3.png" alt="enter image description here"></a></p>
  
  <p>Neither do i have it here (Even after disabling anonymous auth)</p>
  
  <p><a href="https://i.stack.imgur.com/zR8Xw.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/zR8Xw.png" alt="enter image description here"></a></p>
  
  <p>What am i missing to check ? or do for that matter, <strong>im still a noob</strong>.</p>
  
  <p>Edit:</p>
  
  <p><a href="https://i.stack.imgur.com/PL5X6.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/PL5X6.png" alt="enter image description here"></a></p>