Providing Antiforgery Token to Native Mobile Apps

Home - Providing Antiforgery Token to Native Mobile Apps

Girly Saputri Staff asked 8 months ago

I have an ASP.NET WebApi solution in place with all clients using Forms Auth. My MVC consumers are using the following:

@Html.AntiForgeryToken()

And then on all of my API endpoints I validate that the token is set in the header via a WebApiValidateAntiForgeryTokenAttribute.
As I develop my iOS application, I’ve decided to maintain cookies as an auth mechanism. How do I go about generating this token in the iOS client applications?

Your Answer