只允许某些域名来访问网站的API

只允许某些域名来访问网站的API

问题描述:

我有我创建了一个网页API。

I have a web api that I have created.

我要确保只有特定的域可以访问这些数据,我不希望大家访问它。这是东西,是可以实现的?难道是建议?如何将一个去这样做或任何人可以点我到正确的方向 - 物品等......

I want to ensure that only certain domain can access this data, I don't want everyone accessing it. Is this something that is achievable? Is it recommended? How would one go about doing this or can anyone point me into the right direction - articles etc...

感谢所有

有是建立版本2(MVC5)进行的ASP.NET Web API CORS支持:
http://aspnetwebstack.$c$cplex.com/wikipage?title=CORS%20support%20for%20ASP.NET%20Web%20API

There is build in "CORS support for ASP.NET Web API" version 2 (MVC5): http://aspnetwebstack.codeplex.com/wikipage?title=CORS%20support%20for%20ASP.NET%20Web%20API