My team’s exploration of ASP.NET Core and Razor Pages continues, and now we come to something that I was very used to doing in ASP.NET MVC, but hadn’t done at all in Core: using anti-forgery tokens and validation.
Lucky for us, ASP.NET Core has made using these tokens stupid easy. Let’s explore how to use anti-forgery tokens in our ASP.NET Core Razor Pages apps!

Sample Project
As with most of my code-focused blog posts, this one has a sample project with examples over on GitHub. Check it out!

#asp.net razor pages #anti-forgery

Using Anti-Forgery Tokens in ASP.NET Core Razor Pages
1.75 GEEK