What is error 407

The remote server returned an error: (407) Proxy authentication required

I get the following error message when I call a web service:

"The remote server returned an error: (407) Proxy authentication required".

I have the general idea and just adding it can get the code to work

or by using DefaultCredentials in code. My problem is that calling the web service in production works without this.

It seems like there is a non-code solution with Machine.config, but what is it? Right now I can't get into the production box's machine.config file to see what this looks like. I tried updating my machine.config like this but still get a 407 error.


Just add this to the configuration

In the code below, we don't need to hard-code the credentials.

Contact your firewall expert. You open the firewall for PROD servers so that the proxy does not have to be used.

Thank you, your tip helped me solve my problem:

Had to set the credentials in two places to overcome the 407 error:

and voila!

Probably the machine or web.config in prod has the settings in the configuration; You probably won't need the proxy tag.

It is successful.

I had a similar proxy problem. In my case it was enough to add:

I thought of writing this answer as nothing worked from above and you don't want to specify a proxy location.

When using this be sure to take this into account.

And if you use:

Friendly reference: https://medium.com/@siriphonnot/the-remote-server-returned-an-error-407-proxy-authentication-required-86ae489e401b

We use cookies and other tracking technologies to improve your browsing experience on our website, to show you personalized content and targeted ads, to analyze our website traffic, and to understand where our visitors are coming from.

By continuing, you consent to our use of cookies and other tracking technologies and affirm you're at least 16 years old or have consent from a parent or guardian.

You can read details in our Cookie policy and Privacy policy.