Security at first.
MVC best practices reccomend to add the [ValidateAntiForgeryToken] attribute to each [HttpPost] action.
How can I enforce this rule in one unique point of the application?
Security at first.
MVC best practices reccomend to add the [ValidateAntiForgeryToken] attribute to each [HttpPost] action.
How can I enforce this rule in one unique point of the application?
Copyright © 2021 Jogjafile Inc.
The follwing class allow to do this with a FilterProvider
To use the above class add this to the
RegisterGlobalFiltersmethod inglobal.asxfile:Doing this, each
[HttpPost]will check if theHtml.AntiForgeryToken()is in the view.