I am trying to access a webservice that has Windows authentication. I am basically using most of what is written on this page:
$.ajax({
url: url,
method: 'GET',
async: true,
data: {},
dataType: 'json',
crossDomain: true,
xhrFields: {
withCredentials: true
},
beforeSend: function(xhr) {
// set authorization header
xhr.setRequestHeader("Authorization", "Basic " + Base64.encode(username + ":" + password));
},
success: function(data){
// success
},
error: function(request, status, error) {
// handle problem
}
});
I also defined the external hosts on the .plist file. My issue is that I always get an error. To make it worst, nothing comes out on the error function that is slightly useful (this output is from Firefox, to simplify):
Object { readyState=0, status=0, statusText="error"}
I also tried on the simulator, but instead of immediately giving me the error I think its timing out. What I have been seeing, and what I am using, is a request using Basic authentication. So is there a way to actually implement this using Windows authentication?