Sunday, September 6, 2020

AntiForgery in MVC

Prevent Cross-Site Request Forgery (XSRF/CSRF) attacks in ASP.NET Core


AntiForgeryConfig.UniqueClaimTypeIdentifier = ClaimsIdentity.DefaultNameClaimType;


[HttpPost, ActionName("Edit")] [ValidateAntiForgeryToken] public ActionResult EditPost(int? id) {

}

No comments: