Logo
DevUtilsAll-in-one toolkit
Back to all codes
5115xx
5xx — Server Error

Network Authentication Required

The client needs to authenticate to gain network access.

What it means

The HTTP 511 Network Authentication Required status code is generated by intercepting proxies (like captive Wi-Fi portals) rather than origin web servers. It informs the browser client that they cannot access the public internet because they haven't authenticated on the local network architecture layer yet.

How it works

  • 1A user connects to an airport Wi-Fi network and tries to load `https://google.com`.
  • 2The local Wi-Fi router intercepting proxy blocks the request.
  • 3Instead of returning a fake Google page, the router returns a 511 status code alongside a redirection login link.
  • 4The operating system catches the 511 and pops open a login window panel automatically.

Why you're seeing this

  • The client is attempting to make network API requests behind an unauthenticated public Wi-Fi hotspot access point.

How to fix it

  • Open a standard unencrypted web page in a browser to trigger the captive portal authorization process.
  • Agree to the network terms, login, and then restart your application or script.

Framework Implementations

Node.js (Gateway Interceptor)

if (!isUserAuthenticatedToWifi(clientIp)) {
  res.writeHead(511, { 'Content-Type': 'text/html' });
  res.end('<a href="/login">Click here to authenticate on this Network</a>');
}

Real-Life Scenarios

Use this code exclusively if you are developing firewall software, network gateways, hot-spot management consoles, or captive portal landing applications.

Hotel or Airport Captive Portal

You attempt to fetch a resource before agreeing to a hotel's terms of service or paying for access. The network gateway returns 511.

HTTP Transaction

1. Client Request

GET /index.html HTTP/1.1
Host: google.com

2. Server Response

HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
Location: https://wifi-login.airport.local

<html><body>You must login to this network first.</body></html>

SEO Implications

Does not impact your web application server's public SEO visibility since this code only exists on local public routing gateway nodes.

Related Codes

Official Spec

RFC 6585, Section 6