Monday, July 27, 2015

Setting up OWIN for ASP.NET Web API from scratch

If you start out with either an ASP.NET MVC or ASP.NET Web API project using the option "No Authentication", you may notice that you will not get support for OWIN included in your project by default!

Therefore, you will have to add OWIN functionality back into your application step-by-step.

You can use these articles as starting points, but they are missing several pieces of information for hosting ASP.NET Web API in a standard Web Host:

http://www.asp.net/aspnet/overview/owin-and-katana/getting-started-with-owin-and-katana

http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api

Below are the steps that are needed to accomplish this by adding the appropriate NuGet packages:

  •  Microsoft.AspNet.WebApi.Owin
  • Microsoft.Owin.Security.OAuth
  • Microsoft.Owin.Security.Jwt
  • Microsoft.AspNet.WebApi.Cors
  • Microsoft.Owin.Host.SystemWeb
















No comments:

Post a Comment