I have a website that receives a large number of the following errors:
The provided anti-fake token is intended for different requirements than the current user.
The anti-fake cookie token symbol and the form field token do not match.
I want the site not to give an error if the anti-fake token is not intended for the user, but contains the user on the login page, for example:
The anti-fake token provided is intended for the user, but the current user is Garret.
I do not want this exception to apply to any page other than the login page. Therefore, I do not want to add AntiForgeryConfig.SuppressIdentityHeuristicChecks = true;to the entire site. I also want the site to be as secure as possible, as it contains HIPAA data. What can I do to keep it as safe as possible, but still try to prevent this error on the login page because it makes it harder for users to use?
The site is hosted on load balancing servers, but I don't think this is a problem. I think that the error is mainly caused by using the "Back" button of the browser through which the login page was opened before entering the system, having already registered or clicking on the login more than once. Also, some users access it through an application that may not load the page, and simply tries to send login information.
So, please let me know which is the best option to prevent this error on the login page, as far as possible?
source
share