How is Windows Authentication Wired Up?

I'm in the process of creating an ASPNET Core 6 MVC app in VS 2022 which will eventually be deployed in a Docker container. Windows Authentication will be used as it's an internal app. When creating this project from scratch with File -> New Project -> ASP.NET Core 6 Web App (Model-View-Controller) and with Windows Authentication enabled, everything works as expected.

This is where it gets weird. Since this will be a Docker container on Linux, I commented out the IIS settings in launchSettings.json.

{
  //"iisSettings": {
  //  "windowsAuthentication": true,
  //  "anonymousAuthentication": false,
  //  "iisExpress": {
  //    "applicationUrl": "http://localhost:60583",
  //    "sslPort": 44391
  //  }
  //},
  "profiles": {
    "ASPNETCORE6": {
      "commandName": "Project",
      "dotnetRunMessages": true,
      "launchBrowser": true,
      "applicationUrl": "https://localhost:7276;http://localhost:5276",
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    },
    "IIS Express": {
      "commandName": "IISExpress",
      "launchBrowser": true,
      "environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development"
      }
    }
  }
}

To recreate this issue, comment out the following from the generated Program.cs file:

    //using Microsoft.AspNetCore.Authentication.Negotiate;
    
    //builder.Services.AddAuthentication(NegotiateDefaults.AuthenticationScheme)
    //   .AddNegotiate();

    //builder.Services.AddAuthorization(options =>
    //{
    //  options.FallbackPolicy = options.DefaultPolicy;
    //});
    
    //app.UseAuthentication();
    //app.UseAuthorization();

Now, when I run a debugging session using IIS Express, the browser windows renders with my correct domain name being displayed. How is this even possible? Is something being cached? Also, the browser is going to http://localhost:44391/ when debugging with IIS Express even though this is commented out in launchSettings.json.

Note: Windows authentication is not working when I debug with Kestrel, which is what I would expect.

How many English words
do you know?
Test your English vocabulary size, and measure
how many words do you know
Online Test
Powered by Examplum