What is Username Authentication?
Username authentication identifies a proxy client with a username and password rather than by its IP address. HTTP proxies carry the credential in a Proxy-Authorization header, and SOCKS5 negotiates it during the handshake. Most providers also encode routing instructions - country, session identifier, rotation behaviour - inside the username string, so one endpoint can serve many configurations.
An HTTP client sends Proxy-Authorization: Basic followed by the base64 encoding of user:password, either up front or after the proxy answers 407 with a Proxy-Authenticate header naming the scheme. Base64 is encoding rather than protection, so the credential is readable to anything watching the hop between client and proxy unless that hop is itself encrypted. SOCKS5 handles the same job differently. The client advertises the username/password method in its greeting, the proxy selects it, and a short sub-negotiation defined in RFC 1929 carries the two strings before any connect request goes out.
Nearly every tool accepts the compact form http://user:pass@host:port, and nearly every team eventually gets bitten by punctuation inside it. A password containing @, :, / or # breaks the parse and has to be percent-encoded, so @ becomes %40, or the library will read half your password as a hostname. curl takes -x for the proxy and -U for the credential, which keeps the secret out of the URL while still exposing it in the process list on a shared machine. Environment variables such as HTTPS_PROXY accept the same userinfo syntax.
Providers overload the username field because it is the one string every client can pass. A username assembled from an account name plus tokens - a country code, a city, a session identifier, a rotation flag - tells the gateway how to route that connection, so a single host and port covers every combination without issuing new endpoints. Change the session token and the exit IP changes with it; keep the token and you hold the same address for as long as the provider allows. Read the separator rules carefully, since a hyphen inside your account name can be parsed as a token boundary.
Credentials travel, which is both the advantage and the exposure. One pair works from a laptop, a CI runner and a colleague's machine, so it ends up in shell history, container logs, a committed .env file and a screenshot pasted into a support ticket. Rotate the pair when people leave, and use a separate sub-user per project where the provider supports it. Check whether traffic is billed per credential, because that is what lets you trace an unexpected bandwidth spike back to the job that caused it.
Where you meet it
This is the field you fill in inside an antidetect browser profile, a Scrapy middleware or a Playwright launch option, and it is where most first-hour proxy problems live. A 407 means the gateway received a credential it rejected. A connection that opens but exits in the wrong country usually means a geo or session token in the username is malformed and the provider fell back to a default. Copy the string from the dashboard instead of retyping it.
Common questions
What does 407 Proxy Authentication Required mean?
The proxy either received no credential or rejected the one it got. Confirm the client is sending Proxy-Authorization at all, check that reserved characters in the password are percent-encoded, and verify the username matches the format the provider expects, including any country or session tokens appended to the account name.
Can I use special characters in a proxy password?
Yes, though not unescaped inside a URL. Characters such as @, :, / and # carry meaning in the userinfo section and have to be percent-encoded, or the parser will misread where the password ends. Passing credentials through the client's dedicated option instead of the URL avoids the problem entirely.
Does SOCKS5 support username and password authentication?
Yes. The client advertises the username/password method during the initial greeting, the proxy selects it, and the credential is exchanged in a short sub-negotiation described in RFC 1929, before any connection request. SOCKS4 has no equivalent, carrying only a userid field with no password, which is one reason SOCKS5 replaced it.
Related terms
Real 4G/5G mobile and residential IPs
PROXIES.SX runs carrier IPs in 100+ countries with HTTP and SOCKS5 on every endpoint. $4/GB down to $2.40/GB at volume, free endpoints and rotation, and your GB never expire.