11
I need to authenticate a request being sent from an iframe (which is being created through javascript) on a page. The authentication will be done with basic http authentication. I've tried doing
http://user:password@server
but apparently this is unavailable in IE because of a security exception:
http://support.microsoft.com/kb/834489
Is there another way I can add the authentication into the request so the iframe will automatically authenticate with the server? Thanks.
Here's the code I'm currently using that doesn't work:
var url = 'http://userName:test@localhost:12000/Service.svc/GetStatus';
try {
// Attach image to cache auth
var frame = $('<iframe />');
frame.load(function() {
alert('here');
});
$('body').append(frame);
frame.attr('src', url);
//img.remove();
}
catch (e) {
}