Having trouble enabling both Anonymous and Windows authentication working when using http.sys as webserver in ASP.NET core 2.0. It works fine when I host in IIS but refuses to work in http.sys server. Method tags
[Authorize]on HomeController
Windowsaction fails with HTTP 500 and never prompts for authentication.
Program.cs
.UseHttpSys(options => { options.Authentication.Schemes = AuthenticationSchemes.Negotiate | AuthenticationSchemes.NTLM; options.Authentication.AllowAnonymous = true; options.UrlPrefixes.Add("http://localhost:5000"); })
HomeController.cs
[Authorize] public class HomeController : Controller { [Authorize] public IActionResult Windows() { return Content ("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType ); } [AllowAnonymous] public IActionResult Anonymous() { return Content ("You are " + User.Identity.Name + "; Authentication Type:" + User.Identity.AuthenticationType );; } }