511 Network Authentication Required
Network authentication required (captive portal).
The client needs to authenticate to gain network access.
What HTTP 511 Network Authentication Required Means
The client needs to authenticate to gain network access.
Network authentication required (captive portal).
Common Causes
- Captive portal at hotel/airport
- Public Wi-Fi authentication
- Network access control
How to Fix It (For Visitors)
- Open browser to authenticate
- Complete captive portal login
- Agree to terms of service
How to Fix It (For Developers/Admins)
- Implement captive portal detection
- Handle authentication flow
- Redirect to login page
Returning a 511 Network Authentication Required (Code Examples)
If you build APIs or web apps, here is how to send an HTTP 511 response and how to test for it:
Node.js (Express)
app.get('/resource', (req, res) => {
res.status(511).json({ error: 'Network Authentication Required' });
});
Python (Flask)
@app.route('/resource')
def resource():
return jsonify(error='Network Authentication Required'), 511
PHP
<?php
http_response_code(511);
header('Content-Type: application/json');
echo json_encode(['error' => 'Network Authentication Required']);
Check the status with curl
curl -I https://example.com/resource
# Look for: HTTP/1.1 511 Network Authentication Required
Frequently Asked Questions
What does HTTP 511 Network Authentication Required mean?
Network authentication required (captive portal). In short: The client needs to authenticate to gain network access.
Is a 511 Network Authentication Required error my fault or the website's?
511 is a 5xx server-error code, so the problem is on the server side, not your browser or device. As a visitor you can usually only retry; if you run the site, investigate the server.
How do I fix a 511 Network Authentication Required error?
Implement captive portal detection. Handle authentication flow. Redirect to login page.
Official Specification
The 511 Network Authentication Required status code is defined in RFC 6585.