In ASP.NET Core Razor views, what's the role of the AntiForgeryToken?

  • To protect against Cross-Site Request Forgery (CSRF) attacks
  • To encrypt sensitive form data
  • To validate user credentials
  • To enhance page load performance
The AntiForgeryToken in ASP.NET Core Razor views is primarily used to protect against Cross-Site Request Forgery (CSRF) attacks. It generates a hidden form field containing a token that is validated on the server when the form is submitted. This ensures that the form submission originates from a trusted source, preventing unauthorized actions.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *