User.Identity.Name is null in Asp.Net Core 2.x web application using Windows Authentication
问题 Problem When hosting an Asp.Net Core 2.0 or 2.1 Web Application behind IIS with Windows Authentication set to true, and Anonymous Authentication set to false, the User.Identity.Name property is null and User.Identity.IsAuthenticated is false. According to the documentation here, Windows Authentication should just work in Asp.Net Core 2.x when hosting with IIS. Background I'm in the process of migrating an Asp.Net 4.x MVC application over to Asp.Net Core following the Migrate from ASP.NET MVC