title: How to configure Blazor with Windows Authentication and IIS
body: <p>I'm having issues with my Blazor app and Windows Authentication after getting IIS hooked up to it. I've been through the steps in <a href="https://docs.microsoft.com/en-us/aspnet/core/security/authentication/windowsauth?view=aspnetcore-5.0&amp;tabs=visual-studio" rel="nofollow noreferrer">this guide</a> however, everytime I go to the site, I get a chrome dialog asking me for a username and a password. My understanding is that IIS should be handling my windows creds and forwarding it to the site.</p>
  <p><strong>Expected result</strong>:</p>
  <p><a href="https://i.stack.imgur.com/3MeBY.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/3MeBY.png" alt="enter image description here" /></a></p>
  <p><strong>Actual result</strong>:</p>
  <p><a href="https://i.stack.imgur.com/KOBWX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/KOBWX.png" alt="enter image description here" /></a></p>
  <p>I see that IISExpress will run the website as my local domain user, which works just fine and the app lets me in. When I run the site from IIS (when it uses the apppool user) is what I run into issues. I need to be able to authenticate as my user without changing the user that the Apppool runs as.</p>
  <p>Some information of the project</p>
  <p><strong>launchSettings.json</strong>:</p>
  <pre><code>{    
    &quot;iisSettings&quot;: {
      &quot;windowsAuthentication&quot;: true,
      &quot;anonymousAuthentication&quot;: false,
      &quot;iis&quot;: {
        &quot;applicationUrl&quot;: &quot;https://customersupport.dev.local&quot;,
        &quot;sslPort&quot;: 0
      },
      &quot;iisExpress&quot;: {
        &quot;applicationUrl&quot;: &quot;http://localhost:13394&quot;,
        &quot;sslPort&quot;: 44318
      }
    },
    &quot;profiles&quot;: {
      &quot;IIS Express&quot;: {
        &quot;commandName&quot;: &quot;IISExpress&quot;,
        &quot;launchBrowser&quot;: true,
        &quot;environmentVariables&quot;: {
          &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
        }
      },
      &quot;Shelby.CustomerSupport&quot;: {
        &quot;commandName&quot;: &quot;Project&quot;,
        &quot;launchBrowser&quot;: true,
        &quot;environmentVariables&quot;: {
          &quot;ASPNETCORE_ENVIRONMENT&quot;: &quot;Development&quot;
        },
        &quot;dotnetRunMessages&quot;: &quot;true&quot;,
        &quot;applicationUrl&quot;: &quot;https://localhost:5001;http://localhost:5000&quot;
      },
      &quot;IIS&quot;: {
        &quot;commandName&quot;: &quot;IIS&quot;
      }
    }
  }
  </code></pre>
  <p><strong>web.config</strong>:</p>
  <pre><code>&lt;?xml version=&quot;1.0&quot; encoding=&quot;utf-8&quot;?&gt;
  &lt;configuration&gt;
    &lt;location path=&quot;.&quot; inheritInChildApplications=&quot;false&quot;&gt;
      &lt;system.webServer&gt;
        &lt;security&gt;
          &lt;authentication&gt;
            &lt;anonymousAuthentication enabled=&quot;false&quot; /&gt;
            &lt;windowsAuthentication enabled=&quot;true&quot; /&gt;
          &lt;/authentication&gt;
        &lt;/security&gt;
        &lt;handlers&gt;
          &lt;add name=&quot;aspNetCore&quot; path=&quot;*&quot; verb=&quot;*&quot; modules=&quot;AspNetCoreModuleV2&quot; resourceType=&quot;Unspecified&quot; /&gt;
        &lt;/handlers&gt;
        &lt;aspNetCore processPath=&quot;bin\Debug\net5.0\Shelby.CustomerSupport.exe&quot; arguments=&quot;&quot; stdoutLogEnabled=&quot;false&quot; hostingModel=&quot;InProcess&quot;&gt;
          &lt;environmentVariables&gt;
            &lt;environmentVariable name=&quot;ASPNETCORE_HTTPS_PORT&quot; value=&quot;443&quot; /&gt;
            &lt;environmentVariable name=&quot;ASPNETCORE_ENVIRONMENT&quot; value=&quot;Development&quot; /&gt;
          &lt;/environmentVariables&gt;
        &lt;/aspNetCore&gt;
      &lt;/system.webServer&gt;
    &lt;/location&gt;
  &lt;/configuration&gt;    
  </code></pre>
  <p>What am I missing here?</p>