# HTTP 407 Proxy Authentication Required — Meaning, Causes & Fixes

> Like 401, but a proxy between you and the server wants credentials.

407 comes from a proxy, not from the origin server. The proxy requires the client to authenticate before it forwards anything, and says how in a `Proxy-Authenticate` header; credentials go back in `Proxy-Authorization`. You'll mostly meet it on corporate networks.

- Class: 4xx Client Error
- Retry: No — change the request first
- Cacheable by default: no
- Defined in: [RFC 9110 §15.5.8 — 407 Proxy Authentication Required](https://www.rfc-editor.org/rfc/rfc9110.html#section-15.5.8)

## Example response

```http
HTTP/1.1 407 Proxy Authentication Required
Proxy-Authenticate: Basic realm="proxy"
Content-Type: application/json
Content-Length: 41

{"error":"Proxy Authentication Required"}
```

## Common causes

- A corporate proxy requiring a login.
- `HTTP_PROXY` / `HTTPS_PROXY` environment variables set without credentials.
- npm, pip or git going through a proxy that needs authentication.

## How to fix it

1. Include credentials in the proxy URL: `http://user:pass@proxy:8080`, URL-encoding special characters.
2. Configure the tool's own proxy settings (`npm config set proxy …`, `git config --global http.proxy …`).
3. NTLM or Kerberos proxies may need a local helper such as cntlm — ask IT which schemes are supported.

## FAQ

### Why do I get 407 during npm install?

npm is going through a proxy that needs credentials. Set npm config set proxy and https-proxy to a URL that includes your username and password, URL-encoded.

## Related status codes

- [401 Unauthorized](https://www.devkult.com/http/401.md)
- [403 Forbidden](https://www.devkult.com/http/403.md)
- [502 Bad Gateway](https://www.devkult.com/http/502.md)

Open the interactive page: https://www.devkult.com/http/407