Proxy authentication with enterprise SSO means the company's forward proxy recognizes users by the domain account they signed in to their computer with, without asking for a separate password. The proxy answers the first request with a 407 and Proxy-Authenticate: Negotiate. The browser gets a Kerberos ticket and repeats the request with it. The catch: the flow only works on its own in the browser, and scripts on the same network get a 407. This post covers the Negotiate flow, browser settings, the SAML flow in cloud proxies and service accounts.
The Negotiate and Kerberos flow
Proxy authentication is a challenge-and-response loop. The proxy answers a request without credentials with a 407 and lists the schemes it accepts in the Proxy-Authenticate header. The client repeats the same request with a Proxy-Authorization header. This framework was defined in RFC 7235 and is now part of RFC 9110.
On a corporate network the scheme is usually Negotiate. The flow has five steps:
- The client sends the request to the proxy. If the target is HTTPS, this is a
CONNECTrequest. - The proxy responds with
407andProxy-Authenticate: Negotiate. - The client builds a service principal name (SPN) from the proxy's name, for example
HTTP/proxy.corp.example. It asks the domain controller (KDC) for a service ticket for that name. - The client turns the ticket into a base64 token and repeats the request with
Proxy-Authorization: Negotiate <token>. - The proxy decrypts the token with its own key file (keytab). The user's password never crosses the network.
The standard has a small gap. RFC 4559, which defines the Negotiate scheme, states that the mechanism is not used to authenticate to HTTP proxies. Browsers and corporate proxies use the same scheme inside a 407 in practice. That is why behavior can vary by product. When something breaks, check the browser's and the proxy's own documentation first.
Where Basic and NTLM fit
Four methods still show up side by side on corporate proxies. The difference is what crosses the network:
| Scheme | What crosses the network | Status |
|---|---|---|
| Negotiate (Kerberos) | A time-limited service ticket | Recommended |
| NTLM | Challenge-response messages | Legacy, being phased out |
| Basic | base64-encoded user:pass | Not SSO, password on every request |
| Captive portal | A session issued by the identity provider | Cloud proxies |
Basic does not encrypt the password, it only encodes it. If the proxy endpoint is http://, the header travels the internal network in clear text. On a corporate proxy this password is usually the domain password. Whoever captures the header can sign in to email and the VPN with the same password. That is why the Chromium documentation puts Basic last when choosing a scheme.
NTLM takes three steps and is tied to the connection. If a load balancer in between spreads the handshake steps across different connections, authentication never completes. NTLM support in curl and the password prompt that keeps reopening on Windows are covered in our HTTP 407 error post. A short note: in our test, the feature list of curl 8.22.0 shipped with Windows had no NTLM, but it did have SPNEGO.
NTLM can also travel inside the Negotiate header. If a Kerberos ticket cannot be obtained, Windows silently falls back to NTLM. If the token starts with TlRMTVNT, the content is NTLM. These characters are the start of the base64 encoding of the text NTLMSSP.
Automatic sign-in in browsers
Browsers answer a Negotiate challenge from a proxy without checking an allowlist. According to the Chromium documentation, integrated authentication is enabled when the challenge comes from a proxy or when the server is on the allowlist. The AuthServerAllowlist policy is for servers. Firefox's enterprise policy documentation also states that proxies are not checked against these lists. SPNEGO and NTLM are on by default for proxies and can be turned off with the AllowProxies policy.
Automatic sign-in needs a valid ticket on the machine. On a domain-joined Windows machine, the ticket arrives at sign-in. On macOS and Linux the user must first get a ticket with kinit. Without a ticket, the browser opens a password prompt or falls back to NTLM.
The SPN is built from the proxy's name. By default, Chromium uses the canonical DNS name, so if there is a CNAME it takes its target. It does not add ports other than 80 and 443 to the SPN unless a policy enables it. If you configure the proxy by IP address, the client asks for a ticket for HTTP/10.0.0.5 and finds none. If the proxy address comes from a PAC file, check that the file returns a fully qualified domain name, not an IP.
SAML and OIDC in cloud proxies
SAML and OIDC work through browser redirects and do not combine with a 407. The identity provider is a sign-in page. A 407 response cannot take the browser to that page. That is why cloud-based security gateways usually use a captive portal flow:
- The first request with an unknown identity is redirected to the gateway's own sign-in address.
- The sign-in address sends the browser to the company's identity provider. The user signs in with SSO and, if required, MFA.
- The identity provider returns to the gateway with a SAML assertion or an OIDC token.
- The gateway binds the identity to the device for a period of time. The binding can be the source IP address, a gateway cookie or an agent on the device.
With HTTPS, redirecting is not easy. If the gateway cannot get inside the CONNECT tunnel, it cannot inject a redirect into the page. So these products either do TLS inspection or carry the identity with an agent on the device. Identity bound to an IP causes trouble behind NAT. Two people sharing the same public IP can appear under each other's identity.
A client outside the browser cannot complete this flow. A script expecting JSON gets the HTML of the sign-in page and throws a parsing error. With TLS inspection in place, the tool stops with a certificate error. If you see the identity provider's sign-in form in the response body, the problem is not the target site but the gateway's flow.
CLI tools and service accounts
Command-line tools do not read browser policies. Each tool needs Negotiate turned on separately. In curl, --proxy-negotiate is enough. -U : is an empty credential; according to the curl documentation it is only needed to run the authentication code:
# Windows: the session's identity is used (SSPI)
# macOS and Linux: get a ticket with kinit first
curl --proxy-negotiate -U : \
-x http://proxy.corp.example:8080 \
https://example.com/The service name in the SPN is HTTP by default. If the proxy expects a different name, change it with --proxy-service-name. --proxy-anyauth does not always help. In our test the proxy offered Negotiate and Basic, and curl chose Negotiate. There was no ticket, curl did not fall back to Basic and stayed at 407. If you expect Basic, write --proxy-basic.
Other tools behave differently. In Git, the http.proxyAuthMethod setting accepts the value negotiate. According to the Git documentation, the setting only takes effect if the proxy URL contains a username. Python Requests turns the credentials in the proxy URL into a Basic header and does not do Negotiate for proxies on its own.
A scheduled job on a server has no signed-in user. It gets its ticket from a service account's keytab file:
kinit -kt /etc/security/svc-report.keytab svc-report@CORP.EXAMPLE
klist # shows the ticket and its expiry timeThe ticket expires after a few hours. Schedule the job together with ticket renewal. A keytab file is worth as much as a password, so only the service user should be able to read it. Many network teams open another path for server subnets: a separate proxy rule that allows traffic by source IP address.
A proxy service bought from outside the company does not know your corporate directory. At Proxynet, identity is verified with user:pass or an IP whitelist. The difference between the two methods is in our proxy authentication post.
If a server job uses a Residential Proxy, the IP whitelist takes the place of a service account. The server's outbound IP is added to the allowlist once. No password sits in a file.
Troubleshooting
Most SSO errors on a corporate proxy come from the ticket, the clock or the SPN. Start from the symptom:
| Symptom | Likely cause | Check |
|---|---|---|
| 407 loop, prompt keeps reopening | No ticket, or the NTLM connection dropped | klist, token prefix |
KRB_AP_ERR_SKEW | Clock skew between client and KDC | w32tm /query /status |
KRB_AP_ERR_MODIFIED | SPN on the wrong account, or a stale keytab | setspn -Q |
Token starts with TlRMTVNT | No Kerberos, fell back to NTLM | Reach the proxy by its full domain name |
curl SEC_E_NO_CREDENTIALS | No usable credentials on the machine | Domain session or kinit |
| Script gets HTML instead of JSON | Cloud gateway's sign-in page | A separate rule for the server |
Kerberos uses timestamps to block replay attacks. In Microsoft's default domain policy, the allowed clock skew is 5 minutes. A client beyond that skew cannot get a ticket, or the proxy rejects the ticket. This is common on virtual machines and on laptops that have been asleep for a long time.
KRB_AP_ERR_MODIFIED says the proxy could not decrypt the ticket with its own key. If the SPN is registered on two accounts, the KDC encrypts the ticket with the wrong account's key. The result is the same if the proxy account's password changed and the keytab was not renewed. On Windows, these commands do the job:
klist # lists tickets
klist purge # clears the cache, a new ticket is fetched
w32tm /query /status # time source and last sync
setspn -Q HTTP/proxy.corp.example # which account holds the SPNHow we tested
We ran the tests on December 3, 2026 on Windows 11. The client was curl 8.22.0 shipped with Windows (SSPI and SPNEGO enabled). On the other side was a local test proxy we wrote with Node.js 24.22.2. The proxy returned 407 to requests without credentials and logged every incoming Proxy-Authorization header. The machine was not domain-joined. So we did not test getting a Kerberos ticket from a real KDC.
- With
--proxy-negotiate -U :, curl printedSEC_E_NO_CREDENTIALS, sent no header and stopped at 407. - When the proxy offered Negotiate and Basic,
--proxy-anyauth -U user:passchose Negotiate. Neither of the two requests to the proxy carried a header, and the result was 407. - A request to the same proxy with
--proxy-basic -U user:passcarried a Basic header and got a 200.
The bottom line
For SSO on a corporate proxy, use Negotiate with Kerberos, reach the proxy by its full domain name and sync clocks from a single source. Define a service account or an IP rule for jobs outside the browser, and choose an IP whitelist for server jobs that use an external Datacenter Proxy. Above all, do not send the domain password with Basic to a plain HTTP proxy endpoint.
Sources
- RFC 9110, section 11.7: Authenticating Clients to Proxies: rfc-editor.org
- RFC 4559, the SPNEGO-based Negotiate scheme: rfc-editor.org
- HTTP authentication, Chromium design document: chromium.org
- Authentication policy, Firefox enterprise docs: firefox-admin-docs.mozilla.org
- Maximum tolerance for computer clock synchronization: learn.microsoft.com
Frequently asked questions
Which authentication method is used for proxy SSO?
The Negotiate scheme, with Kerberos behind it. The proxy sends Proxy-Authenticate: Negotiate with a 407, and the client passes the service ticket it got from the domain in the Proxy-Authorization header. The password never crosses the network. NTLM does the same job the older, weaker way. In cloud proxies, SSO is usually set up with SAML or OIDC by redirecting the browser to a sign-in page.
Why does Chrome connect to the corporate proxy without asking for a password?
Chrome answers a Negotiate challenge from a proxy without checking an allowlist. On a domain-joined machine, the Kerberos ticket obtained at sign-in is ready. Chrome uses that ticket for the proxy's name and repeats the request. If there is no ticket, or the proxy is configured by IP address, Kerberos does not work. Chrome then falls back to NTLM or opens a password prompt.
Can NTLM still be used?
In the short term yes, but it should not be chosen for new setups. NTLM is a three-step, connection-bound handshake. It breaks easily behind a load balancer. Microsoft has put NTLM on the path to deprecation, and new curl releases are dropping it from the default build. If the proxy only accepts NTLM, ask the network team to enable Negotiate with Kerberos.
How do you connect to a proxy that requires Kerberos with curl?
With --proxy-negotiate -U :. On Windows, curl uses the session's identity through SSPI. On macOS and Linux, get a ticket with kinit first. -U : is an empty credential that only turns on the authentication code. If the proxy expects a different service name, add --proxy-service-name. If something fails, look at the Proxy-Authorization line in the -v output.
How much clock skew does Kerberos allow?
The default limit is 5 minutes. Microsoft's default domain policy uses this value and recommends not changing it. Because Kerberos uses timestamps to block replay attacks, the ticket is rejected once the skew exceeds this limit. The error shows up as KRB_AP_ERR_SKEW. On Windows, check the time source and the last sync time with w32tm /query /status.
Why doesn't a cloud proxy that uses SAML work in scripts?
Because SAML relies on browser redirects. The gateway sends a request with an unknown identity to the identity provider's sign-in page. A script cannot fill in that page, so it gets HTML instead of JSON or fails with a certificate error because of TLS inspection. For server jobs, ask the network team for a separate rule: an allowance by source IP or Kerberos with a service account.




