I have an ASP.NET 5 MVC 6 Web API project. Most of the API endpoints have the [Authorize] attribute, and Windows Authentication is enabled in both IIS and on the properties of the project in Visual Studio. This all works fine in beta 7.
In beta 8, however, this does not work. It's easy to reproduce this with a completely clean project:
- Create a new project using the ASP.NET 5 Web API template.
- Get properties on the project (not the solution), go to the Debug tab, enable Windows authentication and disable Anonymous. Save the changes.
- Hit F5 and let it attempt to run the project.
Result:
An error occurred attempting to determine the process id of the DNX process hosting your application.
- Now go back to the project properties and enable Anonymous. Leave Windows enabled as well. Save the change.
- Go to your controller and add the [Authorize] attribute.
- F5 again.
Result:
The project launches this time, but the web API returns a 500. Notice in the Output window:
Microsoft.AspNet.Mvc.Controllers.ControllerActionInvoker: Warning: Authorization failed for the request at filter 'Microsoft.AspNet.Mvc.Filters.AuthorizeFilter'.
The project also does not work when published to IIS.
As noted in the beta 8 announcement, the hosting model has changed such that IIS is now passing the request through to Kestrel. The Servers page doesn't give any indication that Kestrel supports Windows Authentication. Is there some trick to getting Windows Authentication working in beta 8?