문제

Opened my application in IE.

Created a dummy HTML files and copied the generated hidden field '__RequestVerificationToken" to dummy page.On form submit of this html file I am calling my service. When I opened this dummy page in another tab in IE and on submit. I saw successfully able to submit the data.

ValidateAntiforgey Token failed in this case.

Can any one guide how this kind of issue can be resolved.

도움이 되었습니까?

해결책 2

I got the answer to my Question

Validate Antiforgery Token compares cookie value with the _requestVerificationToken hidden value. So when a html which has _requestVerificationToken hidden field(copied from application) value in a new tab is opened, on submit of this page it passes ValidateAntiforgery validation because cookie value is same for both the tabs.

다른 팁

Do you mind to post your code in which you put the validation? Maybe something like:

[ValidateAntiForgeryToken(Salt="someArbitraryString")]
public ViewResult SubmitUpdate()
{
    // ... etc
}

Thanks!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top