Some proxies require credentials, for example Microsoft ISA server. Usually this is not a problem, because you will most likely be running on a domain account, that can automatically authenticate itself. However in some cases it is not possible to run a process under a domain account. In such cases, you need to provide different credentials.

By default, it is not possible in the .net framework to provide client credentials in the app.config or the web.config of your application. .Net will by default use your current credentials for the proxy.

This class will allow you to override the credentials in a configuration section. After configuration, it works with all .Net networking frameworks: WCF, WebServices, WebRequest, etc. This will save you from manually overriding generated classes to provide the network credentials.

Sample code for registering the configuration:

<sectionGroup name="goodStuff">
  <configSection name="authenticatingProxy" type="GoodStuff.Net.AuthenticatingProxyConfigurationSection, GoodStuff"/>

   <authenticatingProxy proxyUrl="[url]" userName="[userName]" password="[password]" domain="[domain]"/>

Sample configuration for registering the proxy

      <module type="GoodStuff.Net.AuthenticatingProxy, GoodStuff"/>

Last edited Sep 23, 2011 at 1:16 PM by drblame, version 2


No comments yet.