511 Network Authentication Required

The network you are on wants you to sign in before it will let traffic through.

Last updated . How this page is checked.

Status code511
Status textNetwork Authentication Required
Category5xx Server Error
Response has bodyUsually
SpecificationRFC 6585

What does 511 Network Authentication Required mean?

The network you are on wants you to sign in before it will let traffic through. It belongs to the 5xx Server Error class, which means the server failed to fulfil an apparently valid request. The problem is on the server side.

When do APIs return 511?

On hotel, airport and café Wi-Fi with a captive portal. The response is generated by the network's gateway, not by the site you asked for, and its body is normally a login page.

How to fix a 511 Network Authentication Required

Open a browser, complete the network's sign-in page, then try again. For software, the danger is mistaking the portal's reply for the real one: a client that sees 511, or HTML where it expected JSON, should report that the network is not yet open and should not parse the body as if the API had sent it.

Reproduce a 511 response

The fastest way to understand a status code is to trigger one and read the full response. Open the API tester and send a request to https://httpbin.org/status/511 — you will see the 511 status along with every response header the server sent. Comparing those headers against a working request is often what reveals the cause.

When you are debugging a real endpoint, check the response headers as carefully as the body, and confirm you are using the right HTTP method for the operation.

Related 5xx status codes

See also

  • 407 Proxy Authentication Required — A proxy between you and the server wants credentials before it will forward the request.
  • 401 Unauthorized — The request lacks valid authentication credentials. Despite the name, this means unauthenticated.

References