Logo
DevUtilsAll-in-one toolkit
Back to all codes
4074xx
4xx — Client Error

Proxy Authentication Required

Similar to 401 Unauthorized, but indicates that the client needs to authenticate itself in order to use a proxy.

What it means

The HTTP 407 Proxy Authentication Required client error status response code indicates that the request has not been applied because it lacks valid authentication credentials for a proxy server that is between the browser and the server that can access the requested resource.

How it works

  • 1The client sends a request to a proxy server.
  • 2The proxy requires authentication but none was provided.
  • 3The proxy returns 407 with a `Proxy-Authenticate` header.
  • 4The client retries the request, including a `Proxy-Authorization` header.

Why you're seeing this

  • Missing Proxy-Authorization header.

How to fix it

  • Provide valid proxy credentials in the HTTP client.

Framework Implementations

Node.js (Client)

const req = http.request({
  host: 'proxy.com',
  headers: {
    'Proxy-Authorization': 'Basic ' + Buffer.from('user:pass').toString('base64')
  }
});

Real-Life Scenarios

Use this exclusively when developing a proxy server (like Squid or a corporate egress firewall) that requires user login.

Corporate Web Filter

An employee tries to visit a website on a corporate network. The corporate proxy returns 407, forcing the browser to prompt the employee for their Active Directory password before allowing the traffic out to the internet.

HTTP Transaction

1. Client Request

GET / HTTP/1.1
Host: example.com

2. Server Response

HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="Corporate Web Filter"

SEO Implications

None.

Related Codes