M
manas
I have two Web applications.....
One of the application is local and one application is remote..
How can i authenticate my remote web application from my local web
application..
I have a login page from my local web application which should
authenticate the remote web application
I am using
Uri uri = new
Uri("http://abc.xyz.com/Default.aspx?user=Bvhe&pass=bu3n81!&Button=Submit");
try
{
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
myReq.MaximumAutomaticRedirections = 4;
myReq.MaximumResponseHeadersLength = 4;
System.Net.CredentialCache myCache = new CredentialCache();
myCache.Add(uri,"Negotiate",new
NetworkCredential("Bvhe","bu3n81!"));
myReq.Credentials = myCache.GetCredential(uri,"");
System.Net.HttpWebResponse myRes =
(HttpWebResponse)myReq.GetResponse();
Stream receiveStream = myRes.GetResponseStream();
StreamReader readStream = new
StreamReader(receiveStream,Encoding.UTF8);
Response.Write(myRes.ContentLength);
Response.Write(readStream.ReadToEnd());
}
catch(WebException e1)
{
e1=e1;
}
but ..i am not able to authenticate.....it still goes to the login page
of the remote site and not the main page of the remote site..
Any help will be apprecitaed
Thanks
mahesh manas
One of the application is local and one application is remote..
How can i authenticate my remote web application from my local web
application..
I have a login page from my local web application which should
authenticate the remote web application
I am using
Uri uri = new
Uri("http://abc.xyz.com/Default.aspx?user=Bvhe&pass=bu3n81!&Button=Submit");
try
{
HttpWebRequest myReq = (HttpWebRequest)WebRequest.Create(uri);
myReq.MaximumAutomaticRedirections = 4;
myReq.MaximumResponseHeadersLength = 4;
System.Net.CredentialCache myCache = new CredentialCache();
myCache.Add(uri,"Negotiate",new
NetworkCredential("Bvhe","bu3n81!"));
myReq.Credentials = myCache.GetCredential(uri,"");
System.Net.HttpWebResponse myRes =
(HttpWebResponse)myReq.GetResponse();
Stream receiveStream = myRes.GetResponseStream();
StreamReader readStream = new
StreamReader(receiveStream,Encoding.UTF8);
Response.Write(myRes.ContentLength);
Response.Write(readStream.ReadToEnd());
}
catch(WebException e1)
{
e1=e1;
}
but ..i am not able to authenticate.....it still goes to the login page
of the remote site and not the main page of the remote site..
Any help will be apprecitaed
Thanks
mahesh manas