I have been thinking over this issue from past few months. Recently, I have started with complete JS Built front-end, where the forms are posted using Ajax
.
I have a doubt, how to recognize on the server side, from where the data is coming from. Is it coming from actual form
event or it is coming from browser console
.?
What I have tried:
Creating a two way handshake: Before posting the form
, the Application will contact the server, and the server will send a token
inside the cookie, which will be sent back with the form
post. But, even if we post by browser console, that cookie
will go carrying the token. So, Failed.
Binding Hidden Field: But if someone, is posting the data from browser console, he would definitely look for the hidden fields as well. Basically, he'll replicate my AJAX
to send the same request, in the same fashion. FAILED!!
I am not able to figure out this part. Can anyone help?
Thanks in advance.