Hello,
Is there a way to associate and set the credentials for a web proxy via the
config file?
We are writing a client program to access both web services (via
HttpWebClientProtocol subclasses) and direct web requests (via WebRequest
subclasses.) In some cases, we need to go thru a WebProxy, and in other
cases, we go direct. We are able to control this in the client's
configuration file (app.config or machine.config) via the optional
<defaultproxy> element, without any code changes (nice!) However, if a given
configured web proxy requires non-anonymous access (that is, the proxy
returns "HTTP 407 - authentication required" errors), it seems we are
required to modify our code by setting the WebProxy.Credentials property
(perhaps to CredentialCache.DefaultCredentials.) The question is this:
instead of doing this in code, is there a way, via the config file, to:
a) configure the client app configured web proxy to use or not to use some
credentials (instead of anonymous)
b) if the proxy is configured in (a) to use credentials, is there a way to
configure the credentials it should use ("default", or in other cases some
specific username/pwd)?
Any help would be much appreciated! Thanks!