My Code:
function HandleSignUp() {
var CurrentURL = document.URL;
var obj, val;
//ajax call started
$.ajax({
type: "POST",
url: "../../webservice/GetAjaxDataWebService.asmx/RegisterNewUser",
data: "{'UserFullName': '" + $('#SignUpName').val() + "','Email': '" + $('#SignUpEmail').val() + "','Password': '" + $('#SignUpPassword').val() + "'}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function (msg) {
//msg.d contains the return value from web service call
$.colorbox.close();
val = eval(msg);
obj = jQuery.parseJSON(val.d);
UpdateLogin(obj.Email, obj.FirstName);
}
});
//ajax call ended
}
How do I make sure the data sent to WebService using jQuery AJAX is through my site and not some attack.
I have a similar ajax call for Login, where I pass userid and password to a webservice and authenticate.
Is there a way to have a one time request-response token to make sure its a valid web service call.
Let me know if my question is not clear.