I am trying to make a json call, by passing the credentials. If the user is already logged into the system using Sql Membership, how can I pass the credentials without getting this:
Here is the code that calls the web.api:
NOTE: call is being made from cross domain: i.e. www.project.com -> api.project.com
var url = 'http://api.project.com/LookUps/uploadtypes?callback=?';
$.ajax({
type: 'GET',
url: url,
async: true,
xhrFields: {
withCredentials: true
},
jsonpCallback: 'handler',
contentType: "application/javascript",
dataType: 'jsonp',
success: function (json, textStatus, jqxhr) { console.log(jqxhr.responseText); },
error: function (json, textStatus, jqxhr) { console.log(jqxhr.responseText); }
});
Edit:
I still get the login when authentication is disabled. Is there another place for the window authentication setting?