Server Error · 5xx

511 Network Authentication Required

The client must authenticate to the network (captive portal) before accessing the resource.

What 511 Network Authentication Required means

511 Network Authentication Required is the captive-portal status code. When a public WiFi network requires you to log in (hotel, airport, coffee shop), a properly-configured network gateway returns 511 with a body pointing at the login page. Most captive portals do not actually use 511; they intercept all HTTP traffic with a redirect to the login page, which is messier but more compatible with broken clients.

When servers should return it: Return 511 from network gateways when the client has not authenticated to the network.

Common causes

How to fix 511 Network Authentication Required

Example response

HTTP/1.1 511
content-type: text/html
<html><body>You must <a href="https://wifi.example.com/login">log in to the network</a>.</body></html>

Related status codes

Frequently Asked Questions

Do real captive portals use 511?
Most do not. They intercept HTTP traffic and serve a 302 redirect to the login page. 511 is the spec-correct way but causes compatibility issues with old clients.
Defined in: RFC 6585 · Class: 5xx Server Error

More references

For a one-page reference of all HTTP status codes, see the HTTP cheat sheet. For testing API responses, try the API Tester tool. For inspecting responses on the command line, the curl cheat sheet covers the most common flags.