I'm pretty sure I read that .NET can't do proxy server authentication using
Kerberos authentication. You would need that in your scenario as you would
be delegating the user's login credentials to the proxy server.
I think there is a kbase article that covers this.
http://support.microsoft.com/kb/321728/
That Kbase mentions it in terms of IE, but System.Net uses WinInet under the
covers, so I would not be surprised if the same rules apply.
Joe K.
<> wrote in message
news: oups.com...
> 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!
>