HTTP 511 Network Authentication Required
5xx Server Error
- Home
- HTTP Status Codes
- 5xx
- 511
What is HTTP 511 Network Authentication Required?
The 511 (Network Authentication Required) status code indicates that the client needs to authenticate to gain network access. This is typically used by captive portals — public Wi-Fi networks that require login or acceptance of terms before granting internet access. The response should include a link to the authentication portal.
Common Use Cases
- Captive portal authentication (Wi-Fi hotspots)
- Corporate network authentication
- Hotel or airport Wi-Fi login pages
Usage Example
When a user connects to a public Wi-Fi network and tries to browse the web, the captive portal intercepts the request and returns 511 Network Authentication Required. The browser should automatically open the login page specified in the response, where the user can authenticate or accept terms.
# Captive portal response
HTTP/1.1 511 Network Authentication Required
Content-Type: text/html
<html><body>
<h1>Wi-Fi Login Required</h1>
<a href="https://portal.example.com/login">Click here to login</a>
</body></html>
Related Status Codes
Common Mistakes
Mistake: Using 401 or 403 for captive portal authentication
Fix: Use 511 specifically for network-level authentication required by captive portals. 401 and 403 are for HTTP-level authentication and authorization, not network access control.
Mistake: Not providing a redirect URL or login page link in the 511 response
Fix: The 511 response should include a link or redirect to the authentication portal. Without it, users may not know how to authenticate to gain network access.