407 Proxy Authentication Required: Fix Guide

407 Proxy Authentication Required: Fix Guide

The 407 Proxy Authentication Required error means your request was routed through a proxy server that requires authentication, but valid credentials were not provided. This is a common issue when configuring proxies for web scraping, browser automation, or corporate network access. Here is how to diagnose and fix it.

What Does 407 Mean?

A 407 status code is the proxy equivalent of a 401 Unauthorized error. The proxy server sitting between your client and the target server is demanding credentials before it will forward your request. The response includes a Proxy-Authenticate header indicating the authentication method required.

HTTP/1.1 407 Proxy Authentication Required

Proxy-Authenticate: Basic realm="Proxy"

Common Causes

CauseDescription
Missing proxy credentialsUsername/password not included in the request
Wrong credentialsTypo in username or password
Expired credentialsProxy subscription or trial expired
Wrong auth methodUsing Basic auth when Digest is required
IP not whitelistedProxy requires IP whitelist + credentials
Proxy plan limitsFree tier or trial limitations

How to Fix 407 Errors

Fix with cURL

# Method 1: Inline credentials with -x flag

curl -x http://username:password@proxy.example.com:8080 https://httpbin.org/ip

Method 2: Separate proxy and auth flags

curl -x http://proxy.example.com:8080 \

--proxy-user username:password \

https://httpbin.org/ip

Method 3: Using environment variables

export http_proxy="http://username:password@proxy.example.com:8080"

export https_proxy="http://username:password@proxy.example.com:8080"

curl https://httpbin.org/ip

Debug: See the full request/response exchange

curl -v -x http://proxy.example.com:8080 \

--proxy-user username:password \

https://httpbin.org/ip

Fix with Python Requests

import requests

proxies = {

"http": "http://username:password@proxy.example.com:8080",

"https": "http://username:password@proxy.example.com:8080",

}

response = requests.get("https://httpbin.org/ip", proxies=proxies)

print(response.json())

Fix with Python + SOCKS Proxy

pip install requests[socks]
import requests

proxies = {

"http": "socks5://username:password@proxy.example.com:1080",

"https": "socks5://username:password@proxy.example.com:1080",

}

response = requests.get("https://httpbin.org/ip", proxies=proxies)

print(response.json())

Fix in Browser Settings

Chrome:

  1. Go to Settings > System > Open proxy settings
  2. Enter proxy address, port, and credentials
  3. Or use a proxy extension like FoxyProxy or SwitchyOmega

Firefox:

  1. Settings > General > Network Settings > Settings
  2. Select “Manual proxy configuration”
  3. Enter proxy details and check “Use this proxy for HTTPS”

Authentication Methods

The Proxy-Authenticate header tells you which authentication scheme the proxy expects:

MethodHeader ValueHow to Use
BasicBasic realm="..."Send base64-encoded username:password
DigestDigest realm="..."Challenge-response with hashed credentials
NTLMNTLMWindows domain authentication
NegotiateNegotiateKerberos/SPNEGO

Handling Digest Authentication

# cURL handles digest auth automatically with --proxy-user

curl -x http://proxy.example.com:8080 \

--proxy-user username:password \

--proxy-digest \

https://httpbin.org/ip

from requests.auth import HTTPDigestAuth

import requests

For proxy digest auth, encode in URL

proxies = {

"http": "http://username:password@proxy.example.com:8080",

"https": "http://username:password@proxy.example.com:8080",

}

response = requests.get("https://httpbin.org/ip", proxies=proxies)

print(response.status_code)

Troubleshooting Checklist

  1. Verify credentials — Log into your proxy provider’s dashboard and confirm username/password
  2. Check the proxy URL format — Ensure it is http://user:pass@host:port
  3. Special characters in password — URL-encode special characters (e.g., @ becomes %40)
  4. Check proxy plan status — Ensure your subscription is active and has remaining bandwidth
  5. IP whitelist — Some providers require you to whitelist your source IP in addition to credentials
  6. Test with a simple request — Try curl -x http://user:pass@proxy:port https://httpbin.org/ip
  7. Check firewall — Ensure your network allows outbound connections on the proxy port

URL-Encoding Special Characters

If your password contains special characters, encode them:

# Password: p@ss#word!

Encoded: p%40ss%23word%21

curl -x http://username:p%40ss%23word%21@proxy.example.com:8080 https://httpbin.org/ip

from urllib.parse import quote

password = "p@ss#word!"

encoded_password = quote(password, safe="")

proxy_url = f"http://username:{encoded_password}@proxy.example.com:8080"

proxies = {"http": proxy_url, "https": proxy_url}

407 vs 401

Feature401 Unauthorized407 Proxy Auth Required
Who requires authTarget serverProxy server
Header returnedWWW-AuthenticateProxy-Authenticate
Header to sendAuthorizationProxy-Authorization
FixAdd server credentialsAdd proxy credentials



FAQ

Why do I get 407 when my proxy credentials are correct?

Check for special characters in your password that need URL-encoding. Also verify your IP is whitelisted if the proxy provider requires it.

Can I use a proxy without authentication?

Some free proxies and locally hosted proxies do not require authentication. However, most commercial proxy services require credentials for security and billing.

How do I fix 407 in a corporate network?

Contact your IT department for the correct proxy credentials. In Windows environments, NTLM or Kerberos authentication may be required, which is handled automatically by system-level proxy settings.

last updated: March 12, 2026

Scroll to Top
message me on telegram

Resources

Proxy Signals Podcast
Operator-level insights on mobile proxies and access infrastructure.

Multi-Account Proxies: Setup, Types, Tools & Mistakes (2026)