שתף באמצעות


(407) Proxy Authentication Required

Question

Tuesday, January 16, 2018 1:49 PM

Guys,<o:p></o:p>

I've got a client that is trying to register my program (via a registration key located on my website) but he can’t. The application that I designed has error logging and it shows:<o:p></o:p>

System.Net.WebException: The remote server returned an error: (407) Proxy Authentication Required<o:p></o:p>

I think I get the whole proxy thing, but instead of me writing code for him (because everyone else seems has no problem or they figured out a way around the issue), is there something I can tell him to do that would allow my program to reach out to my website to register my program for him to avoid the 407 exception?<o:p></o:p>

Thanks!<o:p></o:p>

ADawn<o:p></o:p>

ADawn

All replies (8)

Tuesday, January 16, 2018 4:48 PM ✅Answered

Yes, just add the system.net node under the configuration node as shown.  It is normal for that node to not exist in the default file (there are a lot of different things you can add to this file).

Reed Kimble - "When you do things right, people won't be sure you've done anything at all"


Tuesday, January 16, 2018 2:44 PM

It looks like you'll have no choice but to modify your program or tell the user that access through a proxy is not supported.  Maybe they can turn off their proxy settings to get registered and then turn it back on (assuming this registration is the only necessary web call to your web server).  Otherwise you need to configure your application to allow authentication through the proxy.

https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/407

https://social.msdn.microsoft.com/Forums/en-US/6e9c13a5-34b7-4c50-9228-fd79f30cb4ed/407-proxy-authentication-required?forum=netfxnetcom

https://stackoverflow.com/questions/2581609/the-remote-server-returned-an-error-407-proxy-authentication-required

https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/defaultproxy-element-network-settings

In app.config place:

<configuration>
  <system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true" />
  </system.net>
</configuration>

Reed Kimble - "When you do things right, people won't be sure you've done anything at all"


Tuesday, January 16, 2018 2:59 PM

Hello Reed,

I get worried about editing the app.config file for some reason.

Can I place the following anywhere under the <configuration> node? system.net doesn't appear to be in that file.

<system.net>
    <defaultProxy enabled="true" useDefaultCredentials="true" />
</system.net>

Thanks,
ADawn

ADawn


Tuesday, January 16, 2018 5:11 PM

Thanks Reed. I'll get it a try.

ADawn

ADawn


Wednesday, January 17, 2018 5:03 PM

Reed,

I'm getting this error message at startup of my application:

ADawn


Wednesday, January 17, 2018 5:03 PM

This is where I put it:

ADawn


Wednesday, January 17, 2018 5:04 PM

Any help would be great.

Thanks,

ADawn

ADawn


Wednesday, January 17, 2018 5:50 PM

Click View Details on the exception dialog and check the InnerException value.  This should provide more information as to what is failing.

Reed Kimble - "When you do things right, people won't be sure you've done anything at all"