4xx Client Errors

HTTP 407 Proxy Authentication Required

The client must first authenticate itself with the proxy.

When is 407 used?

  • Corporate proxy authentication
  • Upstream proxy credential requirements

How to handle a 407 response

Inspect the request — URL, method, headers, credentials, and body. Retrying the same request unchanged will usually fail again; 429 is the exception, where you should wait for the Retry-After period.

Check the status code a URL returns from the command line:

curl -s -o /dev/null -w "%{http_code}\n" https://example.com

How to return 407 from your server

Node.js (Express)

res.status(407).json({ message: 'Proxy Authentication Required' });

Python (Flask)

return {"message": "Proxy Authentication Required"}, 407

Go (net/http)

w.WriteHeader(407)

Frequently Asked Questions

What does HTTP 407 mean?

407 Proxy Authentication Required: The client must first authenticate itself with the proxy.

Is 407 an error?

Yes. 407 is in the 4xx Client Errors class. Client errors: the request is malformed, unauthorized, or targets something that does not exist.