Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
How to validate incoming requests on ASP.NET endpoints using custom ActionFilters
// **********************************************
// Fore more information, visit:
// https://blog.hildenco.com/2017/12/aspnet-allowing-anonymous-requests-on.html
// **********************************************
[HttpPost]
[ValidateAntiForgeryToken]
[RequirePermission("Update")]
public async Task<JsonResult> SomeOperation(string id)
{
// your code here
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment