How does ValidateAntiForgeryToken fit with Web APIs that can be accessed via web or native app?

前端 未结 3 1161
傲寒
傲寒 2021-02-01 10:01

I\'m trying to understand how I will be able to craft an API using ASP.NET Web API which will be protected from CSRF, while still being accessible from non-web environments (e.g

3条回答
  •  面向向阳花
    2021-02-01 10:36

    Have a look at the SPA templates in the latest MVC4 update. They have a sample implementation for Anti-CSRF for Web API.

提交回复
热议问题