HTTP 407 Proxy Authentication — Corporate Proxy Authorization Failures
About HTTP 407 Proxy Authentication
Fix HTTP 407 Proxy Authentication Required errors in corporate environments where proxy servers require credentials for internet access. This guide covers everything you need to know about this topic, including common causes, step-by-step solutions, and answers to frequently asked questions.
Here are the key things to understand: HTTP 407 indicates the client must authenticate with the proxy server before the request is forwarded. Corporate proxy servers commonly require domain credentials (NTLM, Kerberos, or Basic authentication). The proxy responds with Proxy-Authenticate header indicating the supported authentication schemes. CLI tools, Docker, npm, pip, and git often fail behind corporate proxies without explicit configuration. Proxy auto-configuration (PAC) files may route different URLs through different proxy servers. Understanding these fundamentals will help you diagnose and resolve this issue more effectively.
The most common reasons this occurs include: HTTP_PROXY/HTTPS_PROXY environment variables not set for command-line tools. Proxy credentials expired or changed since last configuration. Tool not supporting the proxy authentication scheme (e.g., NTLM not supported by basic HTTP clients). PAC file routing requests to a different proxy than configured. Identifying the root cause is the first step toward finding the right solution.
To resolve this, follow these recommended steps: Set proxy environment variables: export HTTP_PROXY=http://user:pass@proxy:8080 and HTTPS_PROXY similarly. Configure git: 'git config --global http.proxy http://user:pass@proxy:8080'. Configure npm: 'npm config set proxy http://user:pass@proxy:8080' and 'npm config set https-proxy'. For NTLM proxies, use CNTLM or Px as a local proxy that handles NTLM authentication transparently. Check proxy settings in system preferences and ensure CLI tools pick them up. If these steps do not resolve the issue, consider consulting additional resources or a qualified professional.
This article is part of our HTTP Status Codes collection on Error Codes Wiki. We provide comprehensive, up-to-date information to help you find solutions quickly.
Quick Answer
How do I find my proxy server address?
Check System Preferences > Network > Advanced > Proxies on Mac, or Settings > Network > Proxy on Windows. Corporate IT may also provide a PAC file URL.
Overview
Fix HTTP 407 Proxy Authentication Required errors in corporate environments where proxy servers require credentials for internet access.
Key Details
- HTTP 407 indicates the client must authenticate with the proxy server before the request is forwarded
- Corporate proxy servers commonly require domain credentials (NTLM, Kerberos, or Basic authentication)
- The proxy responds with Proxy-Authenticate header indicating the supported authentication schemes
- CLI tools, Docker, npm, pip, and git often fail behind corporate proxies without explicit configuration
- Proxy auto-configuration (PAC) files may route different URLs through different proxy servers
Common Causes
- HTTP_PROXY/HTTPS_PROXY environment variables not set for command-line tools
- Proxy credentials expired or changed since last configuration
- Tool not supporting the proxy authentication scheme (e.g., NTLM not supported by basic HTTP clients)
- PAC file routing requests to a different proxy than configured
Steps
- 1Set proxy environment variables: export HTTP_PROXY=http://user:pass@proxy:8080 and HTTPS_PROXY similarly
- 2Configure git: 'git config --global http.proxy http://user:pass@proxy:8080'
- 3Configure npm: 'npm config set proxy http://user:pass@proxy:8080' and 'npm config set https-proxy'
- 4For NTLM proxies, use CNTLM or Px as a local proxy that handles NTLM authentication transparently
- 5Check proxy settings in system preferences and ensure CLI tools pick them up