{"id":455,"date":"2026-11-27T21:30:00","date_gmt":"2026-11-27T16:00:00","guid":{"rendered":"https:\/\/proxykite.com\/blog\/?p=455"},"modified":"2026-11-27T21:30:00","modified_gmt":"2026-11-27T16:00:00","slug":"error-401-proxy","status":"publish","type":"post","link":"https:\/\/proxykite.com\/blog\/error-401-proxy\/","title":{"rendered":"Error 401 Unauthorized: Fix It in Browsers, APIs and Proxies"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Error 401 means the request reached a server that needs valid authentication before it will return the protected resource. Fix the login, token, cookie, or request header first; if the response is actually from your proxy, look for HTTP 407 instead.<\/p>\n\n\n\n<aside class=\"ap-card\" aria-label=\"ProxyKite per-dongle licence\">\n<span class=\"ap-card__badge\">Useful for proxy testing<\/span>\n<div class=\"ap-card__body\"><p class=\"ap-card__name\">ProxyKite per-dongle licence<\/p><p class=\"ap-card__best\">Best for anyone turning their own 4G\/LTE dongles + SIMs into HTTP\/SOCKS5 mobile proxies, from 1 dongle to hundreds<\/p><ul class=\"ap-card__features\"><li>Every dongle becomes an HTTP + SOCKS5 proxy on a public port of our cloud router \u2014 no static IP or port forwarding, works behind CGNAT<\/li><li>IP rotation on demand, by rotation link, or on a timer from 60 s to 7 days (sticky option); returns old + new IP<\/li><li>One-line installer on a Raspberry Pi \/ Linux box; Huawei E3372 HiLink is the reference stick<\/li><li>SIM inbox for carrier messages, bandwidth limits per day\/week\/month, live traffic insights<\/li><li>Sub-users, white-label (your logo\/colours), REST API, webhooks and Telegram alerts included<\/li><li>Flat price, traffic is free \u2014 rides on your own SIM data plans<\/li><\/ul><\/div>\n<div class=\"ap-card__side\"><p class=\"ap-card__price\">$9 per dongle <small>per month<\/small><\/p><a class=\"ap-card__btn\" href=\"https:\/\/proxykite.com\/#pricing\">Talk to us \u2192<\/a><\/div>\n<\/aside>\n\n\n\n<h2 class=\"wp-block-heading\">What you need<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have the exact URL that failed, the client that made the request, and the complete response status and headers. If a proxy is involved, also note its protocol, host, port, and authentication mode.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Use a harmless endpoint for repeatable tests, such as <code>https:\/\/example.com\/<\/code>, and keep a working direct request beside the proxied request. Do not paste real API keys, proxy passwords, cookies, or bearer tokens into a ticket or shared terminal transcript.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a quick reference, the <a href=\"https:\/\/proxykite.com\/docs\/guide\/authentication\">ProxyKite authentication guide<\/a> shows how API bearer tokens are sent and why API credentials are separate from credentials used by a proxy request.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img decoding=\"async\" src=\"https:\/\/proxykite.com\/blog\/wp-content\/uploads\/2026\/11\/error-401-proxy-1.webp\" alt=\"ProxyKite\u2019s authentication guide shows the bearer-token header and explains that a missing, wrong, revoked, or expired token returns 401.\"\/><figcaption class=\"wp-element-caption\">ProxyKite\u2019s authentication guide shows the bearer-token header and explains that a missing, wrong, revoked, or expired token returns 401.<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">What error 401 means<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">HTTP 401 is formally an authentication challenge from the origin server: the server handling the requested website, application, or API resource. The response should include a <code>WWW-Authenticate<\/code> header describing a scheme the client can use, such as <code>Bearer<\/code> or <code>Basic<\/code>. The <a href=\"https:\/\/www.rfc-editor.org\/rfc\/rfc9110.html#name-401-unauthorized\" target=\"_blank\" rel=\"noopener\">HTTP specification<\/a> and <a href=\"https:\/\/developer.mozilla.org\/en-US\/docs\/Web\/HTTP\/Reference\/Status\/401\" target=\"_blank\" rel=\"noopener\">MDN\u2019s 401 reference<\/a> document this exchange.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u201cUnauthorized\u201d is an awkward name. In most cases, it means \u201cthe server could not authenticate this request\u201d, not that your account has been definitively denied. The request may have no credentials, an expired session, a malformed token, the wrong password, or credentials for a different host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">The response headers give you the first useful clue:<\/p>\n\n\n\n<figure class=\"wp-block-table ap-table\"><table><thead><tr><th>Header or status<\/th><th>What it usually tells you<\/th><\/tr><\/thead><tbody><tr><td><code>401 Unauthorized<\/code><\/td><td>The server handling the resource needs usable authentication<\/td><\/tr><tr><td><code>WWW-Authenticate: Bearer<\/code><\/td><td>Send an access token using the bearer scheme<\/td><\/tr><tr><td><code>WWW-Authenticate: Basic<\/code><\/td><td>The server is challenging for Basic username and password<\/td><\/tr><tr><td><code>403 Forbidden<\/code><\/td><td>The server understood valid credentials but will not allow this action<\/td><\/tr><tr><td><code>407 Proxy Authentication Required<\/code><\/td><td>A proxy needs its own credentials before forwarding the request<\/td><\/tr><tr><td><code>Proxy-Authenticate<\/code><\/td><td>The proxy is describing its authentication challenge<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">The last two rows matter when you use a mobile, office, or rotating proxy. A destination website can return 401 through a correctly working proxy. That does not make the proxy the cause.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1: Read the response before changing credentials<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: the status and challenge header tell you whether to fix the destination login, an API token, or the proxy connection.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Request only the headers with curl:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --include --silent --show-error \\\n  --output \/dev\/null \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">If you need connection details as well, use verbose mode:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --verbose \\\n  --output \/dev\/null \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Look for lines like these:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt; HTTP\/2 401\n&lt; www-authenticate: Bearer<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">That is an origin authentication challenge. It is different from:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt; HTTP\/1.1 407 Proxy Authentication Required\n&lt; Proxy-Authenticate: Basic<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">The response may use lowercase header names because HTTP field names are case-insensitive. What matters is which header is present and which component sent the status.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like a clear classification: <code>401<\/code> plus <code>WWW-Authenticate<\/code> means destination authentication; <code>407<\/code> plus <code>Proxy-Authenticate<\/code> means proxy authentication. A DNS failure, timeout, TLS error, or connection refusal is a separate network problem and needs a different fix.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2: Fix a 401 in a browser<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: a browser normally authenticates a website with a login session, cookie, or HTTP authentication prompt, not with the credentials for your proxy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Work through these checks in order:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li>Confirm the address and path. A protected dashboard, API route, and public landing page may use different authentication rules.<\/li>\n\n\n<li>Open the same URL in a private window. This separates an expired or corrupted cookie from a server-side account problem.<\/li>\n\n\n<li>Sign in again at the website\u2019s normal login page. Do not type a destination account password into a proxy prompt, and do not type a proxy password into the website\u2019s login form.<\/li>\n\n\n<li>If the private window works, remove the site\u2019s stale cookies and saved login data, then sign in again in the normal profile.<\/li>\n\n\n<li>Check the browser\u2019s developer tools on the failing request. Compare the working and failing requests for the <code>Cookie<\/code>, <code>Authorization<\/code>, and request URL fields.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">If the server sends <code>WWW-Authenticate: Basic<\/code>, the browser may show a username-and-password dialog. Enter the credentials for that protected resource. If it keeps appearing, verify the realm, host, password, and account status with the site owner; repeatedly submitting the same value does not repair a bad credential.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the request goes through an HTTP proxy and the browser shows a proxy login dialog, that is a separate hop. Enter the proxy credentials there. A successful proxy login can still be followed by a 401 from the destination site.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like a fresh browser session can load the protected page and the network panel shows a normal authenticated response. If only one page fails while the rest of the site works, check that page\u2019s permissions and URL rather than changing the proxy.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3: Fix a 401 in an API client<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: APIs usually do not have a browser session to refresh. They expect a token or key in the exact header and format documented for that API.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a bearer token, a minimal request looks like this:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>export API_TOKEN='replace-with-a-token'\n\ncurl --include \\\n  --header \"Authorization: Bearer ${API_TOKEN}\" \\\n  --header 'Accept: application\/json' \\\n  'https:\/\/api.example.com\/v1\/resource'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Check each part of the request:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n\n<li>The token is current and belongs to the account or project that owns the resource.<\/li>\n\n\n<li>The header says <code>Authorization<\/code>, not <code>Authentication<\/code>.<\/li>\n\n\n<li>The value has the required scheme, such as <code>Bearer<\/code>, followed by one space and the token.<\/li>\n\n\n<li>The request uses the correct API hostname, version, path, and HTTP method.<\/li>\n\n\n<li>The client is not sending an empty environment variable or a token with copied quotation marks.<\/li>\n\n\n<li>A reverse proxy, SDK, or redirect is not dropping the <code>Authorization<\/code> header.<\/li>\n\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Do not assume that a token that authenticates one service authenticates another. API keys, dashboard login sessions, proxy <code>user:pass<\/code> credentials, and bearer tokens are different credential types unless the provider explicitly says otherwise.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the service offers token scopes or access levels, check that the token can access the endpoint. A valid token without the required permission is normally a 403, while a missing, invalid, revoked, or expired token is normally a 401. The exact error body is application-specific, so use the status and the service\u2019s current API documentation together.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like the same URL returns the expected JSON response with the corrected header. Keep the token in an environment variable or secret store; do not commit it to a script or leave it in shell history when a safer method is available.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4: Separate a destination 401 from a proxy 407<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: using the wrong authentication option can make a working proxy appear broken, or make you send a website credential to the wrong server.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">First test the destination without a proxy if your network allows it:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --include --silent --show-error \\\n  --output \/dev\/null \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Then test through the proxy with no proxy credentials, only if the endpoint allows you to inspect its challenge:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --verbose \\\n  --proxy 'http:\/\/PROXY_HOST:PROXY_PORT' \\\n  --output \/dev\/null \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Read the first HTTP response in the verbose output. If it contains <code>407<\/code> and <code>Proxy-Authenticate<\/code>, the proxy has not accepted usable proxy authentication. If the proxy connection succeeds and the destination later returns <code>401<\/code> with <code>WWW-Authenticate<\/code>, fix the destination credentials instead.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If the response is 407, follow the more detailed checklist in <a href=\"https:\/\/proxykite.com\/blog\/http-error-407-proxy-authentication-required\/\">HTTP 407 proxy authentication errors<\/a>. It covers endpoint formats, user:pass credentials, IP allowlists, browsers, and Python clients.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a proxy using username and password, use <code>--proxy-user<\/code> or its short form <code>-U<\/code>:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --verbose \\\n  --proxy 'http:\/\/PROXY_HOST:PROXY_PORT' \\\n  --proxy-user 'PROXY_USER:PROXY_PASSWORD' \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Do not use <code>--user<\/code> for this test. <code>--user<\/code> supplies credentials to the destination server; <code>--proxy-user<\/code> supplies credentials to the proxy. Curl\u2019s <a href=\"https:\/\/curl.se\/docs\/manpage.html\" target=\"_blank\" rel=\"noopener\">official manual<\/a> documents both proxy selection and proxy authentication options.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">If you use a SOCKS5 endpoint, select the exact scheme and port provided by the proxy service:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>curl --verbose \\\n  --proxy 'socks5h:\/\/PROXY_HOST:PROXY_PORT' \\\n  --proxy-user 'PROXY_USER:PROXY_PASSWORD' \\\n  'https:\/\/example.com\/protected'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">For a URL-aware client, a password containing <code>@<\/code>, <code>#<\/code>, <code>\/<\/code>, <code>?<\/code>, or <code>:<\/code> must be percent-encoded when embedded in a proxy URL. Using separate proxy and credential fields avoids many parsing mistakes. The <a href=\"https:\/\/proxykite.com\/docs\/guide\/proxy-formats\">ProxyKite proxy format guide<\/a> covers the supported host, port, user, and password arrangements.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like the proxy authentication completes and the final status belongs to the destination. A destination 401 after a successful 407 exchange is proof that the proxy hop got far enough to deliver the request.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5: Check the client\u2019s actual request<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Why: a correct credential can still fail when the application reads a different configuration file, inherits an old environment variable, or follows a redirect to another host.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Compare the failing client with the smallest working curl request. Keep the destination, proxy host, proxy port, and authentication mode identical, then change one variable at a time.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Check these common sources of drift:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n\n<li><code>HTTP_PROXY<\/code>, <code>HTTPS_PROXY<\/code>, <code>ALL_PROXY<\/code>, and <code>NO_PROXY<\/code> environment variables.<\/li>\n\n\n<li>A browser PAC file or system proxy setting that overrides the application setting.<\/li>\n\n\n<li>A trailing space or newline copied into a token or password.<\/li>\n\n\n<li>A redirect from one hostname to another, where credentials are intentionally not forwarded.<\/li>\n\n\n<li>A client library that sends <code>Authorization<\/code> to the wrong host or removes it after redirecting.<\/li>\n\n\n<li>A clock that is badly out of date when the token uses time-based validation.<\/li>\n\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">Capture verbose output only in a safe test environment. Redact <code>Authorization<\/code>, <code>Proxy-Authorization<\/code>, cookies, query-string tokens, and private response data before sharing it. The <a href=\"https:\/\/proxykite.com\/docs\/guide\/authentication\">ProxyKite authentication documentation<\/a> is also useful when the failing request is an API call to ProxyKite rather than traffic routed through a proxy.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">For a repeatable proxy-side check, use the <a href=\"https:\/\/proxykite.com\/blog\/test-proxy-with-curl\/\">curl proxy testing guide<\/a> to compare exit IPs, authentication, DNS mode, and response timing after the 401\/407 classification is clear.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Success looks like the application produces the same status and response as the known-good curl request. If the two differ, the problem is in request construction or configuration, not in the HTTP status code itself.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Verify the fix<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Run the smallest repeatable request three times: once directly, once through the proxy without destination credentials if appropriate, and once with the corrected destination authentication. Record only the status, relevant challenge header, and a redacted response summary.<\/p>\n\n\n\n<figure class=\"wp-block-table ap-table\"><table><thead><tr><th>Result<\/th><th>Next interpretation<\/th><\/tr><\/thead><tbody><tr><td>DNS, timeout, or connection failure<\/td><td>Fix reachability, host, port, or TLS before authentication<\/td><\/tr><tr><td><code>407<\/code> with <code>Proxy-Authenticate<\/code><\/td><td>Fix proxy credentials, protocol, port, or allowlist settings<\/td><\/tr><tr><td><code>401<\/code> with <code>WWW-Authenticate<\/code><\/td><td>Fix the destination login, token, cookie, or auth scheme<\/td><\/tr><tr><td><code>403<\/code> after authentication<\/td><td>Check account permissions or token scope<\/td><\/tr><tr><td><code>2xx<\/code> or the expected application response<\/td><td>The authentication path is working<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">If the request succeeds only once, check token expiry, cookie lifetime, rotation of secrets, and any load-balanced session requirement. A working request is evidence of a correct path, not proof that every credential or permission is correct.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Troubleshooting checklist<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">The browser keeps asking for a password<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Identify whether the prompt belongs to the website or the proxy. Clear the matching saved credential, open a private window, and enter the credential for that specific hop. If the prompt repeats, inspect the <code>WWW-Authenticate<\/code> or <code>Proxy-Authenticate<\/code> challenge and confirm the expected scheme.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Curl returns 401 but the browser works<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The browser may be sending cookies, a CSRF token, an <code>Authorization<\/code> header, or a required redirect response that curl does not have. Use the browser\u2019s \u201ccopy as cURL\u201d feature in a controlled environment, compare the request, and then reduce it to the one authentication mechanism the API actually requires.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Curl returns 407 but the API returns 401<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">These are separate credentials. Put the API token in <code>Authorization<\/code> for the destination and the proxy login in <code>--proxy-user<\/code>; do not replace one with the other.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">The token looks correct but still fails<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Check the hostname, audience, scope, expiry, revocation status, and whether an SDK is overwriting the header. Generate a new token only through the service\u2019s normal security controls, then revoke exposed tokens rather than sharing them in logs.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQ<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">Is error 401 the same as 403 Forbidden?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">No. A 401 normally means the server cannot authenticate the request and is challenging for usable credentials. A 403 normally means the server understood the credentials but will not permit that action or resource.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Why do I get 401 when using a proxy?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The destination website or API may be rejecting its own login, token, or session after the proxy forwards your request. Inspect the response headers: <code>WWW-Authenticate<\/code> points to destination authentication, while <code>Proxy-Authenticate<\/code> with status 407 points to the proxy.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">How do I fix 401 in curl?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Send the credential in the format required by the destination, such as <code>--header \"Authorization: Bearer TOKEN\"<\/code> for a bearer API. If the proxy also needs authentication, configure it separately with <code>--proxy-user<\/code>; do not use <code>--user<\/code> as a substitute.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Can a proxy cause a 401 error?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A proxy can forward a destination\u2019s 401 to you, which makes the error appear while the proxy is enabled. Under standard HTTP semantics, the proxy\u2019s own authentication challenge is 407, so check which challenge header accompanies the response.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Should I retry a 401 request automatically?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Only retry after correcting or refreshing the credential, and avoid repeated retries with the same invalid secret. For APIs, respect the provider\u2019s token and session rules; a retry loop will not turn a malformed, expired, or revoked token into a valid one.<\/p>\n\n\n\n<aside class=\"ap-cta\" aria-label=\"Test your 401 path\"><div class=\"ap-cta__content\"><p class=\"ap-cta__eyebrow\">Need proxy help<\/p><p class=\"ap-cta__title\">Test your 401 path<\/p><p class=\"ap-cta__text\">Tell us your client, proxy format, and redacted response headers so we can point you to the right authentication hop.<\/p><\/div><a class=\"ap-cta__btn\" href=\"https:\/\/proxykite.com\/contact\">Contact ProxyKite<\/a><\/aside>\n\n\n\n<script type=\"application\/ld+json\">{\"@context\": \"https:\/\/schema.org\", \"@type\": \"FAQPage\", \"mainEntity\": [{\"@type\": \"Question\", \"name\": \"Is error 401 the same as 403 Forbidden?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"No. A 401 normally means the server cannot authenticate the request and is challenging for usable credentials. A 403 normally means the server understood the credentials but will not permit that action or resource.\"}}, {\"@type\": \"Question\", \"name\": \"Why do I get 401 when using a proxy?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"The destination website or API may be rejecting its own login, token, or session after the proxy forwards your request. Inspect the response headers: WWW-Authenticate points to destination authentication, while Proxy-Authenticate with status 407 points to the proxy.\"}}, {\"@type\": \"Question\", \"name\": \"How do I fix 401 in curl?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Send the credential in the format required by the destination, such as --header \\\"Authorization: Bearer TOKEN\\\" for a bearer API. If the proxy also needs authentication, configure it separately with --proxy-user; do not use --user as a substitute.\"}}, {\"@type\": \"Question\", \"name\": \"Can a proxy cause a 401 error?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"A proxy can forward a destination\u2019s 401 to you, which makes the error appear while the proxy is enabled. Under standard HTTP semantics, the proxy\u2019s own authentication challenge is 407, so check which challenge header accompanies the response.\"}}, {\"@type\": \"Question\", \"name\": \"Should I retry a 401 request automatically?\", \"acceptedAnswer\": {\"@type\": \"Answer\", \"text\": \"Only retry after correcting or refreshing the credential, and avoid repeated retries with the same invalid secret. For APIs, respect the provider\u2019s token and session rules; a retry loop will not turn a malformed, expired, or revoked token into a valid one.\"}}]}<\/script>\n\n","protected":false},"excerpt":{"rendered":"Fix error 401 with practical browser, API, and proxy checks, including WWW-Authenticate, bearer tokens, curl -v, and the 401 versus 407 test.","protected":false},"author":1,"featured_media":456,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"csco_singular_sidebar":"","csco_page_header_type":"","csco_page_load_nextpost":"","footnotes":""},"categories":[6],"tags":[299,121,297,298,82],"class_list":["post-455","post","type-post","status-publish","format-standard","has-post-thumbnail","category-troubleshooting","tag-api-authentication","tag-curl","tag-error-401","tag-http-401","tag-proxy-authentication","cs-entry"],"_links":{"self":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/455","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/comments?post=455"}],"version-history":[{"count":1,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions"}],"predecessor-version":[{"id":713,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/posts\/455\/revisions\/713"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/media\/456"}],"wp:attachment":[{"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/media?parent=455"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/categories?post=455"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/proxykite.com\/blog\/wp-json\/wp\/v2\/tags?post=455"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}