I have a WCF service hosted in IIS. Authentication mode is set to Windows in web.config and IIS level.
I have a user interface from which the service gets called from jQuery ajax method.
Here is how I am calling service from jQuery.
$.ajax({
async: true,
type: "POST",
contentType: "application/json; charset=utf-8",
crossDomain: true,
xhrFields: {
withCredentials: true
},
data: <<Data>>,
url: <<Service url>>,
success: function (data) {
OnFetchSuccess(<<Some Params>>);
},
error: function () { }
});
This call fails with error code 401 (Unauthorized).
Can someone please help in this issue?