How does ValidateAntiForgeryToken fit with Web APIs that can be accessed via web or native app?
问题 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. native mobile applications). My first thought would be that a non-web environment can never successfully pass an anti-forgery token validation, since it doesn't have a form that is posted. Is this true? Is there any way to make validation work? If there isn't a way to validate, my second thought is to offer an API