jquery - passing credentials not working -
i trying make json call, passing credentials. if user logged system using sql membership, how can pass credentials without getting this:
here code calls web.api:
note: call being made 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 login when authentication disabled. there place window authentication setting?
to prevent popup have change url following.
var url = 'http://username:password@api.project.com/lookups/uploadtypes?callback=?';
replace username - actual username , password actual password.
Comments
Post a Comment