title: Automatic Windows Authentication without login dialog using Identity Server 4
body: <p>We have a setup where Identity Server 4 (IS4), running in IIS using .NET Core 3.1, will authenticate users via Windows AD or credentials stored in a database.  The problem I'm trying to resolve is when we have an internal web site, currently built using ReactJS, that authenticates against IS4, a dialog popups up asking for the user to enter their credentials.  What we want is for the user to be automatically logged into IS4 via their Windows domain account with no prompt for the user to enter their credentials.</p>
  <p>Below is the setup
  <strong>IIS</strong></p>
  <ul>
  <li>SSL enabled</li>
  <li>Authentication:  Anonymous and Windows Authentication Enabled.</li>
  </ul>
  <p><strong>IS4</strong></p>
  <ul>
  <li>Web Host definition (Program.cs)
  <code>WebHost.CreateDefaultBuilder(args).UseSerilog().UseStartup&lt;Startup&gt;();</code></li>
  <li>Windows Authentication Configuration (Startup.cs)</li>
  </ul>
  <pre><code>public void ConfigureServices(IServiceCollection services) 
      {
          ...
          services.Configure&lt;IISOptions&gt;(iis =&gt;
          {
              iis.AuthenticationDisplayName = &quot;Windows&quot;;
              iis.AutomaticAuthentication = true;
          });
      }
  
      public void Configure(IApplicationBuilder app)
      {
          ...
          app.UseIdentityServer();
          app.UseAuthorization();
      }
  </code></pre>
  <p><strong>ReactJS</strong></p>
  <ul>
  <li>Nothing special configured here.</li>
  <li>Running via npm start from the command line, not using IIS.</li>
  </ul>
  <p>I think that is all of the related code and configuration.  We have logic that is setup to detect if the client is configured for automatic Windows authentication so that they don't get redirected to the IS4 Account login page.</p>