Please provide guidance on how to implement Windows Authentication on ASP.NET Core RC2+.
I see other SO questions that describe bearer authentication like Bearer Authentication with ASP.NET Core RC2 404 instead of 403
But that is not what I am looking for.
Check your launchSettings.json file - change anonymousAuthentication to false
For deployment to iis check this Asp.Net core MVC application Windows Authentication in IIS
You can do this using WebListener, like so:
Open your project.json and add WebListener to dependencies:
Add WebListener to commands (again in Project.json)
In Startup.cs, specify the WebHostBuilder to use WebListener with NTLM
That's it!
This doesn't appear to work any longer in the .Net Core 1.0.0 (RTM). I do the WebHostBuilder exactly as above in Ivan Prodanov's answer; it runs, don't get an error there, but the HttpContext.User is not marked with a WindowsIdentity. Following code used to work in ASP.Net 5 beta6:
in project.json:
in middleware class: