Brief We introduced CORS support in ASP.NET Web API a few months ago . Out of the box it supports configuring CORS policy by attributes. It is a very intuitive and powerful way but lacks flexibility at runtime. Imaging your service allows a 3rd party to consume your service. You need the capability of updating the allowing origins list without compiling and deploying your service each time the list changes. In following this article, I show you two examples of dynamically managing your CORS policy. Manage your CORS allowed origins in a SQL database. Manage your CORS allowed origins in the web.config file. Prerequisites Visual Studio Express 2013 Preview for Web or Visual Studio 2013 Preview . QUnit . Bootstrap (optional) Set up the test environment...(read more) ...
Go to the complete details ...