Skip to main content
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
added 12 characters in body
Source Link
Raman Gupta
  • 2.7k
  • 2
  • 12
  • 35

On a customer site, we have implemented multiple Sitecore 9 Forms on the same page. One of these forms is used to sign-in to the website.

When customers submit the sign-in form, the other forms seem to be triggered as well – the next form will throw an error like this: Anti forgery token is meant for user “” but the current user is “username”

Anti forgery token is meant for user “” but the current user is “username”

This was a common problem in Sitecore when having multiple MVC forms on a page at the same time. The workaround for MVC forms is to add the ValidateRenderingTokenValidateRenderingToken attribute to all the POST methods before the ValidateAntiForgeryTokenValidateAntiForgeryToken attribute. The ValidateRenderingTokenValidateRenderingToken stops the execution of any method that wasn’t triggered by the submitted form.

How to use the AntiForgeryToken with a custom log-in form?

https://stackoverflow.com/questions/14970102/anti-forgery-token-is-meant-for-user-but-the-current-user-is-username

We need to do something similar for our Sitecore 9 Forms, but we don’t have an MVC Action method – we’re working with Form Submit Actions instead.

Has anyone faced this issue before? Do you have an idea how to resolve the problem?

On a customer site, we have implemented multiple Sitecore 9 Forms on the same page. One of these forms is used to sign-in to the website.

When customers submit the sign-in form, the other forms seem to be triggered as well – the next form will throw an error like this: Anti forgery token is meant for user “” but the current user is “username”

This was a common problem in Sitecore when having multiple MVC forms on a page at the same time. The workaround for MVC forms is to add the ValidateRenderingToken attribute to all the POST methods before the ValidateAntiForgeryToken attribute. The ValidateRenderingToken stops the execution of any method that wasn’t triggered by the submitted form.

How to use the AntiForgeryToken with a custom log-in form?

https://stackoverflow.com/questions/14970102/anti-forgery-token-is-meant-for-user-but-the-current-user-is-username

We need to do something similar for our Sitecore 9 Forms, but we don’t have an MVC Action method – we’re working with Form Submit Actions instead.

Has anyone faced this issue before? Do you have an idea how to resolve the problem?

On a customer site, we have implemented multiple Sitecore 9 Forms on the same page. One of these forms is used to sign-in to the website.

When customers submit the sign-in form, the other forms seem to be triggered as well – the next form will throw an error like this:

Anti forgery token is meant for user “” but the current user is “username”

This was a common problem in Sitecore when having multiple MVC forms on a page at the same time. The workaround for MVC forms is to add the ValidateRenderingToken attribute to all the POST methods before the ValidateAntiForgeryToken attribute. The ValidateRenderingToken stops the execution of any method that wasn’t triggered by the submitted form.

How to use the AntiForgeryToken with a custom log-in form?

https://stackoverflow.com/questions/14970102/anti-forgery-token-is-meant-for-user-but-the-current-user-is-username

We need to do something similar for our Sitecore 9 Forms, but we don’t have an MVC Action method – we’re working with Form Submit Actions instead.

Has anyone faced this issue before? Do you have an idea how to resolve the problem?

Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Bumped by Community user
Source Link
dthrasher
  • 273
  • 1
  • 8

Multiple Sitecore 9 Forms can cause AntiForgery token validation errors

On a customer site, we have implemented multiple Sitecore 9 Forms on the same page. One of these forms is used to sign-in to the website.

When customers submit the sign-in form, the other forms seem to be triggered as well – the next form will throw an error like this: Anti forgery token is meant for user “” but the current user is “username”

This was a common problem in Sitecore when having multiple MVC forms on a page at the same time. The workaround for MVC forms is to add the ValidateRenderingToken attribute to all the POST methods before the ValidateAntiForgeryToken attribute. The ValidateRenderingToken stops the execution of any method that wasn’t triggered by the submitted form.

How to use the AntiForgeryToken with a custom log-in form?

https://stackoverflow.com/questions/14970102/anti-forgery-token-is-meant-for-user-but-the-current-user-is-username

We need to do something similar for our Sitecore 9 Forms, but we don’t have an MVC Action method – we’re working with Form Submit Actions instead.

Has anyone faced this issue before? Do you have an idea how to resolve the problem?