This project is read-only.

GoodStuff.Net.AuthenticatingProxy

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"/>
</sectionGroup>

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

Sample configuration for registering the proxy

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

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

Comments

No comments yet.