511 Network Authentication Required

The client must authenticate with the network itself, typically a captive portal on public Wi-Fi.

Status

HTTP/1.1 511 Network Authentication Required

Details

511 exists so captive portals stop lying. Before it, a hotel or airport network would intercept a request and return 200 with a login page, which corrupted caches and confused clients that had asked for something else entirely. 511 states plainly that the network, not the origin, is intercepting.

The response is generated by an intermediary and should not be cached. Operating systems use it as one of the signals that a network requires sign-in.

Note: 511 comes from the network you are on, not from the site you requested. Proxy authentication failures are 407 instead.

Headers

Common causes

How to fix it

As the client

As the server

Examples

A captive portal intercepting a request

HTTP request

GET /api/status HTTP/1.1
Host: api.example.com

HTTP response

HTTP/1.1 511 Network Authentication Required
Content-Type: text/html; charset=utf-8

<a href="https://wifi.example.net/login">Sign in to use this network</a>

Notes for proxy users

A 511 while using a proxy means your own network is intercepting traffic before it reaches the proxy. It is not a proxy authentication problem: that is 407. Clear the portal first, then retry.

Specifications

See also