The remote server returned an error: (407) Proxy Authentication


Periodically, I find myself writing an N-Tier, SaaS app written in Winforms or WPF for a Bank or Energy firm, that uses proxies.

400px-Proxy_concept_en_svg

In fact, as security becomes a better understood component, providing a standardised environment in the enterprise, the more companies typically use proxy servers.

Every once in a while I come across the dreaded message The remote server returned an error: (407) Proxy Authentication Required. 

There is an article here that explains the issue. Make sure you add this to your app.config between the configuration nodes.

<system.net>

<defaultProxy enabled=true useDefaultCredentials=true>

<proxy autoDetect=True usesystemdefault=True/>

</defaultProxy>

</system.net>

<defaultProxy> Element (Network Settings)

enabled  Specifies whether a web proxy is used. The default value is true.

useDefaultCredentials  Specifies whether the default credentials for this host are used to access the web proxy. The default value is false.

 <proxy> Element (Network Settings)

autoDetect Specifies whether the proxy is automatically detected. The default value is unspecified.

usesystemdefault Specifies whether to use Internet Explorer proxy settings. If set to true, subsequent attributes will override Internet Explorer proxy settings. The default value is unspecified.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s