# Proxy authentication

> Proxy authentication is how a proxy confirms you are allowed to use it, usually with a username and password or by accepting connections only from IP addresses you have registered.

URL: https://residentialips.org/glossary/proxy-authentication/  
Updated: 2026-11-28  
Publisher: ResidentialIPs Editorial Team

Also known as: proxy credentials, proxy login, proxy auth

## Key takeaways

- The two common methods are username/password and IP allowlisting.
- HTTP proxies challenge with 407 and receive credentials in Proxy-Authorization.
- SOCKS5 negotiates authentication in its handshake (RFC 1929).
- Many providers encode targeting options (country, session) in the username.
- Basic proxy credentials are not encrypted on the way to the proxy.

## What is proxy authentication?

A commercial proxy must know which customer is sending traffic, both to bill usage and to keep strangers out. Proxy authentication is that check. Without it, the proxy would be an [open proxy](https://residentialips.org/glossary/open-proxy/) that anyone could abuse.

## Methods compared

|  | Username and password | [IP allowlisting](https://residentialips.org/glossary/ip-whitelisting/) |
| --- | --- | --- |
| Works from any network | Yes | Only from registered IPs |
| Tool support | Most tools, some lack it | Any tool, no credentials needed |
| Carries targeting options | Yes, in the username | No, usually via ports instead |
| Risk if exposed | Anyone with the credentials can use your plan | Low |
| Good for | Laptops, changing networks, many sub-users | Fixed servers, tools without auth support |

## How HTTP proxy authentication works

1. The client sends a request (or CONNECT) without credentials.
2. The proxy returns `407 Proxy Authentication Required` with `Proxy-Authenticate: Basic realm="proxy"`.
3. The client repeats the request with `Proxy-Authorization: Basic dXNlcjpwYXNz` (base64 of `user:pass`).
4. The proxy validates and forwards the request.

Most clients send credentials upfront when you put them in the proxy URL, so you rarely see the 407 step. Basic credentials are only encoded, so they travel in readable form unless you connect to the proxy over TLS.

## How SOCKS5 authentication works

The client lists supported methods in its greeting. If the server selects username/password (method 0x02), the client sends the username and password in a short sub-negotiation defined by RFC 1929. The server replies with success or failure before any traffic flows.

## Targeting in the username

Providers often turn the username into a settings string, for example `customer-acme-country-de-city-berlin-session-9x2`. This lets you change location or session without changing host or port. Read your provider’s documentation for the exact format.

## Troubleshooting

| Symptom | Likely cause |
| --- | --- |
| 407 on every request | Wrong credentials, special characters not URL-encoded, IP not allowlisted |
| Works in curl, fails in a browser | Browser does not support credentials for that proxy type, use allowlisting or an extension |
| SOCKS5 connection refused | Tool does not support SOCKS5 username/password |

## Choosing a method for your setup

| Setup | Recommended method | Why |
| --- | --- | --- |
| Script on a server with a fixed IP | [IP allowlisting](https://residentialips.org/glossary/ip-whitelisting/) | No credentials stored in code |
| Laptop on changing networks | Username and password | Works wherever you are |
| Browser or antidetect profiles | Username and password per profile | Each profile can use different targeting |
| Shared team access | Separate sub-users per person | Usage tracking and easy revocation |

Many providers let you create sub-users with their own passwords and traffic limits. Use them instead of sharing your main account password.

## Keeping proxy credentials safe

- Store credentials in environment variables or a secrets manager, not in code committed to a repository.
- Rotate passwords if they appear in logs, screenshots or support tickets.
- Remember that Basic authentication sends the password encoded but not encrypted. Over a plain HTTP connection to the proxy, anyone on the network path can read it.
- Remove old allowlisted IPs when you change servers, so the next owner of that IP cannot use your plan.

## Example: credentials in common tools

```
# curl
curl -x http://USER:PASS@proxy.example:8000 https://api.ipify.org

# environment variables read by many tools
export HTTPS_PROXY="http://USER:PASS@proxy.example:8000"
```

If the password contains special characters such as `@` or `:`, URL-encode them, for example `@` becomes `%40`. Unencoded special characters are a frequent cause of mysterious 407 errors.

## Authentication and rotation

For rotating residential plans, the username often does double duty: it identifies your account and carries targeting and session settings. Changing the session part of the username gives you a new IP; keeping it the same keeps the IP. That is why mistakes in the username can show up as 407 errors or as unexpected locations.

## Frequently asked questions

### What does 407 Proxy Authentication Required mean?

The proxy did not receive valid credentials. Check the username and password, encode special characters, or add your IP to the allowlist.

### Is IP allowlisting more secure than a password?

It cannot leak like a password, but it trusts anyone on the allowlisted IP. On shared networks or changing IPs, credentials are more practical.

### Are proxy passwords encrypted?

Not with standard HTTP Basic or SOCKS5 username/password. They are readable to anyone on the network path to the proxy, unless the proxy connection itself uses TLS.

### Why does my proxy keep asking for a password in the browser?

Browsers prompt for HTTP proxy credentials and some forget them between sessions. Allowlisting your IP, or using a profile manager that stores proxy credentials, avoids the prompt.

### Can I use the same credentials on several machines?

Usually yes for username and password plans, subject to concurrency limits. Allowlisting needs every machine’s IP added.

## Sources and further reading

- [RFC 9110: HTTP Semantics, 407 and Proxy-Authorization (IETF)](https://www.rfc-editor.org/rfc/rfc9110)
- [RFC 7617: The Basic HTTP Authentication Scheme (IETF)](https://www.rfc-editor.org/rfc/rfc7617)
- [RFC 1929: Username/Password Authentication for SOCKS V5 (IETF)](https://www.rfc-editor.org/rfc/rfc1929)
