Anti Forgery

You can leverage ASP.NET MVC's AntiForgery token support your Razor pages by embedding the token in your HTML Forms with:


<form action="/antiforgery/test" method="POST">
    <input name="Field" value="Test"/>        
    <input type="submit"/>

Which you can then validate in your Service with:

public class AntiForgeryTest
    public string Field { get; set; }

public class AntiForgeryService : Service
    public object Any(AntiForgeryTest request)


ASP.NET MVC's AntiForgery API is only available in the .NET Framework