I have a public facing website that is developed with ASP.NET MVC 3. The MVC application contains controllers with actions that return JSON. The web pages execute AJAX requests against the actions that return JSON.
Even though the data that is published with the JSON action is not sensitive, it is proprietary, and I’m concerned that anybody can call the actions that return JSON through cross domain calls or custom applications. Is there a way to only allow my MVC application webpages access to the actions that return JSON? Does ODATA provide any benefits for solving this problem?
Does anyone know of resources that describes this issue as a liability and how to solve it?
If your application is public, then its more tricky. There’s the
ValidateAntiForgeryTokenattribute which can help against XSS and random requests.If you have a password protected site, use the
Authorizeattribute.OData has the same set of problems the MVC site would have.