What is HTTP 401 Unauthorized?
The 401 Unauthorized response indicates that a client must authenticate before accessing the requested resource.
Despite the name, the issue is usually missing or invalid authentication rather than permissions.
Common Causes
- Missing authentication token
- Expired JWT tokens
- Invalid API keys
- Incorrect credentials
Example
HTTP/1.1 401 Unauthorized
DevOps Considerations
401 responses commonly appear when debugging APIs, identity providers, and authentication middleware.
Summary
401 Unauthorized means the client must provide valid authentication details.