same windows authentication credential for multiple website issue

  asp.net-mvc, authentication, jquery, windows

I have created a parent website which contains all child website link, Where we can redirect to child website with the help of parent website, But my problem is I have windows authentications for both parent and child website ,When I open my parent website it will ask me for windows username and password after entering my parent website will open, But when I try to redirect to my child it will again ask for windows authentication pop that I don’t ,I want only one time it will ask me for windows authentication for parent website not for child website can someone help me out with the solution.

What I have tried is

<script type="text/javascript">
    function CallWebApp(strURL) {
        //$.ajax({
        //    type: "GET",
        //    data: {},
        //    url: strURL,
        //    dataType: 'json',
        //    xhrFields: {
        //        withCredentials: true
        //    },
        //    crossDomain: true
        //});
        alert(strURL);
        $.ajax({
            url: strURL,
            dataType: 'json',
            crossDomain: true,
            xhrFields: { withCredentials: true },
            success: function (data) {
                //console.log(data);
                //alert("Success:"+ data);
                //window.open(strURL);
                var w = window.open();
                var html = data;
                $(w.document.body).html(html);
            },
            error: function (Er) {
                //alert("Error: "+ Er);
                //window.open(strURL);
                var a = JSON.stringify(Er);
                var w = window.open();
                var html = a;
                $(w.document.body).html(a.responseText);
                
                //alert("Err: "+a);
            }
        });
    }

</script>

Source: Windows Questions

LEAVE A COMMENT