Have you tried assigning the Credentials to the WebRequest object in addition to the Proxy? From there you might parse the current user's logon domain from the current Thread object and pass that along
string domain = System.Threading.Thread.CurrentPrincipal.Identity. Name; // == MY_DOMAIN\USERNAM
System.Net.HTTPWebRequest req = (Systen.Net.HTTPWebRequest
System.Net.WebRequest.create(adress)
System.Net.WebProxy myproxy = new System.Net.WebProxy(proxyHost, proxyPort)
myProxy.Credential = new System.Net.Credentials(login, password, domain)
req.Credential = myProxy.Credential
req.Proxy = myProxy
One warning: the domain the user logs into normally may not necessarily be the domain they authenticate on to access the proxy. It could be the local proxy machine, in which case you would need to determine the name of that machine and pass that along instead.
D
----- Prehaut Anselme wrote: ----
"Dave Loynd" <dl****@afts.com> a écrit dans le message d
news:eJ**************@TK2MSFTNGP11.phx.gbl..
I'm a little rusty in this area, but generally I think the user woul
suppl the domain, supposing they know which domain they log into in the firs
place. If you leave the domain blank, Windows will attempt t
authenticat the user in the default domain as set in IIS. That having been said
ther is no way I'm aware of to easily retrieve the domain name from th
outside
Do you have some code you can post to show simply what/where your trouble
begin
D
The code is very simply
I create a webreques
System.Net.HTTPWebRequest req = (Systen.Net.HTTPWebRequest
System.Net.WebRequest.create(adress)
ifi've found that there is a proxy I set up this prox
System.Net.WebProxy myproxy = new System.Net.WebProxy(proxyHost, proxyPort)
req.Proxy = myProxy
I try to establish a connection through this prox
req.GetResponse()
If en exception is thrown and if this Exception is a 407 WebExceptio
(authenticate required) I ask the user for is login and password and i d
this proces
System.Net.HTTPWebRequest req = (Systen.Net.HTTPWebRequest
System.Net.WebRequest.create(adress)
System.Net.WebProxy myproxy = new System.Net.WebProxy(proxyHost, proxyPort)
myProxy.Credential = new System.Net.Credentials(login, password)
req.Proxy = myProxy
But here, with a NT User the request is still a 407 Exception
I think it's because I need to create the credentials like this
myProxy.Credential = new System.Net.Credentials(login, password, domain)
But I don't know where to retrieve this information, in the registry (lik
the proxy information)
Th
Anselm