Remote login

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.Cre­ate(uri);
myReq.MaximumAutomaticRedirect­ions = 4;
myReq.MaximumResponseHeadersLe­ngth = 4;


System.Net.CredentialCache myCache = new CredentialCache();
myCache.Add(uri,"Negotiate",ne­w
NetworkCredential("Bvhe","bu3n­81!"));
myReq.Credentials = myCache.GetCredential(uri,"");


System.Net.HttpWebResponse myRes =
(HttpWebResponse)myReq.GetResp­onse();


Stream receiveStream = myRes.GetResponseStream();
StreamReader readStream = new
StreamReader(receiveStream,Enc­oding.UTF8);
Response.Write(myRes.ContentLe­ngth);


Response.Write(readStream.Read­ToEnd());


}


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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
474,470
Messages
2,571,809
Members
48,797
Latest member
PeterSimpson
Top