Proxy auth with default credentials



Ok, I've managed to get authenticated on my proxy by doing :

System.Net.WebRequest req;
req = System.Net.WebRequest.Create("http://www.mywebsite.com/";);
System.Net.WebProxy prx = new
System.Net.WebProxy("http://myproxyserver",true);
System.Net.CredentialCache cache = new System.Net.CredentialCache();
cache.Add( new Uri( "http://myproxyserver"; ), "NTLM", new
System.Net.NetworkCredential("username", "password", "domain") );

I want this to be an app on the intranet and use the impersonated users
details. I've setup IIS to auth using integrated authentication, the
..net app is set to impersonate=true and windows authentication. The box
is set to be trusted for delegation etc.

But I can't figure out how in code to create the cache entry for the
proxy server for the impersonated user. I don't want to hardcode a
un/pw for obvious reasons but I can't see any other way. I've tried to
use the System.Net.CredentialCache.DefaultCredential but I just get a
proxy auth required message if I try it.

BTW, for some reason setting the proxies credential to the
DefaultCredential doesn't seem to work, if I look at a packet trace it
tries to negotiate authentication with the proxy server but it does it
under "Negotiate" rather than "NTLM" - this seems to make a difference.

Help!

.



Relevant Pages

  • Re: Proxy server with HttpListener
    ... class using sockets that will write the authentication details to your ... that captured HTTP request to your company proxy. ... How can I send the HttpListenerRequest to the internet and put the ...
    (microsoft.public.dotnet.framework.webservices)
  • Re: httpwebrequest with https behind proxy with authentication
    ... contact Microsoft Customer Support ... httpwebrequest with https behind proxy with authentication ... Our proxy server uses NTLM authentication and as you suggested I ...
    (microsoft.public.dotnet.framework)
  • RE: HttpWebRequest over Https Via Proxy Fails using NTLM
    ... request a resource over HTTPS is failing following the installation of a new ... proxy server on our internal network with 407 Proxy Authentication Required. ... Is there any way to debug the ntlm authentication module to see exactly what ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Wi-fi hotspot implementations
    ... FreeBSD, using php and mysql for the authentication, squid for the ... have authenticated full access through the proxy. ... This strikes me as a bit of overkill for a coffee shop. ... Proxy servers are nice for security and anonymity, ...
    (alt.internet.wireless)
  • Re: httpwebrequest with https behind proxy with authentication
    ... Our proxy server uses NTLM authentication and as you suggested I modified the code as follows: ... I still receive "The remote server returned an error: Proxy Authentication Required." ... and it works if I use http instead of https or if I disable authentication on the proxy ... Microsoft MSDN Online Support Lead ...
    (microsoft.public.dotnet.framework)