Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.9TtSrW0hzOs" is not present

Question: How do you resolve the error in .Net 5 Login: Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The required antiforgery cookie ".AspNetCore.Antiforgery.9TtSrW0hzOs" is not present

Answer:  Asp.Net Core doesn't generate anti-forgery tokens for safe HTTP methods, one way to solve this error is to include a built-in Action Filter on the Loggin Action called [AutoValidateAntiforgeryToken]. This will allow the Framework to decide when to validate an AntiforgeryToken.


Edit this Article
.Net 5 AntiforgeryValidationException .NET 5 published
Was this page helpful?
Yes Yes! this solution to the problem was helpful. No No! this solution to the problem was not helpful.. Leave ErnesTech Feedback.Feedback
If you log in, you will be notified when someone leaves a comment.

Other users would like to know if this solution helped you.

Your Session is Ending
Login to Continue

© 2021 - ErnesTech - Privacy