Proxy Authentication: Definition and Setup for Rotating Proxies

To use the proxy, your client sends a username and password to the gateway. For rotating proxy services, this authentication is typically embedded in the connection string used to configure your software.

In short
  • Authentication uses a username and password, with the username encoding proxy network and location options.
  • Our gateway supports HTTP and SOCKS5 authentication on specific ports.
  • Without correct credentials, you receive a 407 Proxy Authentication Required error.
  • Each proxy user can have its own network permissions and monthly traffic cap.

What Is Proxy Authentication?

Proxy authentication is a security mechanism where a client must present valid credentials, usually a username and password, to a proxy server before it will forward traffic to the internet. This ensures that only authorized users can consume bandwidth and access the proxy network. In the context of a rotating proxy service, this authentication also serves as the control point for specifying which network to use, which geographic location to target, and whether to use a rotating or sticky session.

How Proxy Authentication Works with Rotating Proxies

When you use a rotating proxy gateway, your software sends a connection request that includes an authentication header. The gateway checks the provided username and password against its authorized user database. If valid, it assigns an exit IP from the requested network and location, establishes the connection to your target site, and begins metering traffic. The authentication step happens on every new TCP connection you open to the gateway, whether you are using the HTTP CONNECT method on port 7070 or the SOCKS5 protocol on port 7071.

Proxy Authentication Username and Password Format

Your proxy authentication credentials consist of a login and a password created in your account dashboard. The username is not just a simple identifier; it uses a specific grammar where the base login is followed by underscore-separated options that control the proxy's behavior. For example, a username like USERNAME_net.res_cc.us_st.ca_city.los-angeles tells the gateway to use the residential network, exit in the United States, specifically in California, and ideally in Los Angeles. The password is a separate secret string. This format allows for flexible targeting without changing your code, which is essential for tasks like price monitoring across different regions.

Setting Up Proxy Authentication in Your Code

To use proxy authentication, you configure your HTTP client or browser to use the gateway host, port, and your credentials. The exact method varies by library. For instance, in Python with the requests library, you would pass a dictionary to the proxies argument. You can find detailed examples in our Python requests proxy guide. For headless browsers used in rank tracking, you would set the proxy arguments when launching the browser, as shown in the Playwright Python proxy integration. The key is to ensure the full username string, including all options, and the password are passed correctly to avoid a 407 error.

Common Proxy Authentication Errors and Solutions

The most frequent error is "407 Proxy Authentication Required." This means the proxy gateway did not accept the credentials you sent. Common causes include a typo in the password, missing underscores in the username, or using an expired or paused proxy user. Another issue is sending the credentials in the wrong part of the request; for HTTP proxies, they must be in the Proxy-Authorization header, not the regular Authorization header used for website logins. Our proxy error 407 help page details troubleshooting steps. If your target site returns a 403 error, it's likely an IP block, not an authentication problem, which is a different challenge discussed in our guide on how to avoid getting blocked.

Proxy Authentication vs. Other Security Methods

Proxy authentication using username and password is the standard method for controlling access to a shared proxy gateway. Some services offer IP allowlist authentication, where traffic is allowed only from pre-registered server IPs. Our service does not use IP allowlists because they are incompatible with dynamic, rotating IP networks and with users who have changing source IPs. Authentication via credentials is more flexible and secure for a pay-as-you-go model, as it ties usage directly to an account balance. This is a core part of how pay as you go proxy billing works, where traffic is metered per authenticated user.

Managing Proxy Users and Authentication

Your account dashboard lets you create up to 25 separate proxy users, each with its own login and password. This allows you to segment traffic for different projects or teams. For each user, you can restrict which networks (residential, mobile, datacenter, ISP) it can use and set an optional monthly gigabyte cap. This is useful for proxies for market research where you might want to separate high-volume data collection from more sensitive, lower-volume tasks. You can also pause a proxy user's authentication instantly, which stops all its traffic. Learn more in the how to create a proxy user guide.

Related Proxy Concepts

Understanding proxy authentication connects to several other key concepts. The gateway (gateway) is the single hostname and port where you send all your authenticated requests. IP rotation (ip rotation) is the process of getting a new exit IP, which is controlled by the presence or absence of a session ID in your username. Sticky sessions (sticky session) use the sid option to maintain the same IP for a period, which is crucial for workflows that require logged-in states, such as proxies for social media management. Finally, the traffic from all authenticated users draws from a single prepaid balance, detailed in our volume rates explained page.

Questions

Can I use one proxy login for several applications simultaneously?

You can use the same proxy user credentials from multiple machines or apps at the same time. Your account's limit is on concurrent connections (up to 1,000), not on where the credentials are used. Just ensure the total traffic stays within any monthly GB cap you've set for that user.

What should I do if I lose my proxy user's password?

You can reset a proxy user's password at any time in the dashboard. This generates a new password; the old one immediately stops working. Your username and its options remain unchanged. This is different from your main account password, which is covered in lost password and recovery code.

Does proxy authentication work for both HTTP and HTTPS websites?

Yes. When you authenticate to the gateway on port 7070, it supports both plain HTTP and HTTPS via the CONNECT method. The authentication is performed at the initial proxy connection level. Once authenticated, the gateway establishes a TLS tunnel to the target HTTPS site, and your credentials are not sent to the final website.

Why does my proxy authentication fail when I add a city target?

If you specify a city that is not available in our published list for that country, the gateway will reject the authentication. Check the city token spelling (lowercase, hyphens for spaces). If your needed city isn't listed, you can still target the country. More details are in what if my city is not listed.

Is proxy authentication data encrypted?

The authentication exchange between your client and our gateway is encrypted if you connect over TLS. We recommend connecting to our gateway using an HTTPS proxy URL (e.g., <code>https://gw.rotatingproxy.cc:7070</code>) which encrypts the initial handshake, including your credentials. The SOCKS5 protocol on port 7071 also supports authentication within its protocol flow.

Can I test my proxy authentication without writing code?

Absolutely. You can use command-line tools like <code>curl</code> or <code>wget</code>. For example, <code>curl -x http://USERNAME:PASSWORD@gw.rotatingproxy.cc:7070 https://api.ipify.org</code> will test the connection and show your exit IP. We have a dedicated how to test a proxy connection guide with more examples.

Start with one top-up, use any network

Create an account in a minute, add $40 or more, and the same balance pays for residential, mobile, datacenter and ISP traffic.