T
toa
Hi!
I'm trying to send a http request from a Windows form to a third-party
server. At the outset, I got an exception - error "407 proxy authentication
required", which I suppose is a message from my company's proxy server,
requiring me to authenticate myself before it will let me out on the
Internet at large.
I then did this:
System.Net.HttpWebRequest HR = null;
System.Net.NetworkCredential NCR;
NCR = new System.Net.NetworkCredential("MyLogon", "MyPassword", "MyDomain");
HR = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strURL);
HR.Credentials = HR.Proxy.Credentials = NCR;
I.e., I added a NetworkCredential to the request, giving my own username,
password and domain. It then works fine. Except I don't want to have to give
this information in my app - after all, my users will be logged on to
Windows already as they start the app, they shouln't be required to give
their credentials again when starting this app. So how do I go about
presenting the current Windows-login credentials to the proxy?
TIA
Torgeir Apeland
I'm trying to send a http request from a Windows form to a third-party
server. At the outset, I got an exception - error "407 proxy authentication
required", which I suppose is a message from my company's proxy server,
requiring me to authenticate myself before it will let me out on the
Internet at large.
I then did this:
System.Net.HttpWebRequest HR = null;
System.Net.NetworkCredential NCR;
NCR = new System.Net.NetworkCredential("MyLogon", "MyPassword", "MyDomain");
HR = (System.Net.HttpWebRequest)System.Net.WebRequest.Create(strURL);
HR.Credentials = HR.Proxy.Credentials = NCR;
I.e., I added a NetworkCredential to the request, giving my own username,
password and domain. It then works fine. Except I don't want to have to give
this information in my app - after all, my users will be logged on to
Windows already as they start the app, they shouln't be required to give
their credentials again when starting this app. So how do I go about
presenting the current Windows-login credentials to the proxy?
TIA
Torgeir Apeland