How can I know from a web application whether another web application is authenticated or not without using redirects?
<p>I have two asp.net web  applications AppClient and AppServer. How can I know from AppClient whether AppServer is Authenticated or not?</p>

<p>I do not want to redirect to the server then redirect to the client. I hope if I can do that in background.</p>

<hr>

<p><strong>What I've tried so far</strong>:</p>

<p>In the server (AppServer): I created a page called IsAuthenticated.aspx in the AppServer and made it write in the <code>Response</code> whether AppServer is authenticated or not.</p>

<pre><code>Response.Write(User.Identity.IsAuthenticated);
</code></pre>

<p>And in the client, I wrote the following code:</p>

<pre><code>string url = "http://appServer/isauthenticated.aspx";
System.Net.HttpWebResponse response;
System.Net.HttpWebRequest request;

request = (HttpWebRequest)WebRequest.Create(url);
request.Method = "GET";
request.ContentType = "text/html";
request.Proxy.Credentials = CredentialCache.DefaultCredentials;
request.Credentials = CredentialCache.DefaultCredentials;
request.ServicePoint.ConnectionLimit = 25;
response = (HttpWebResponse)request.GetResponse();
StreamReader sr = new StreamReader(response.GetResponseStream());
string result = sr.ReadToEnd();
</code></pre>

<p>This code above works well but it does not do the expected result. The response returns always <code>false</code> even the AppServer is Authenticated.</p>

<p>Actually I understand what is happenning and seems my implementation is not true. Do you have any other suggestion ?</p>
