I have a system with two sites in the same domain. The two sites are in separate folders of the same domain, something like this:
http://renan/foo
http://renan/bar
The first site (let's call it " foo
") has a page that accesses data from another site (" bar
") via Ajax. When the user is logged on both, everything happens as desire. But when the user is only logged in foo
, the browser displays a prompt asking for user name and password. Authentication is done via Active Directory and not all users of each site should have access to the other.
I would like that, in case the user is logged in foo
not in bar
, the login prompt does not appear. I wanted to treat it as a mistake. Is there any way to verify that the system would ask for authentication and prevent the prompt from appearing?
Here is a snippet of the code I'm using for the request:
$.ajax({
headers: {
"accept": "application/json;odata=verbose",
"content-type": "application/json;odata=verbose"
},
type: "GET",
url: "http://renan/bar/baz",
beforeSend: function (xhr) {
xhr.withCredentials = true;
}
})