401 Unauthorized
The HTTP status meaning the request has no valid credentials, so the caller must authenticate first.
In more detail
Despite its name, 401 is about authentication, not permission. It must carry a WWW-Authenticate header naming the scheme to use, such as Basic or Bearer. A caller with valid credentials but not enough permission gets 403 instead.
Example
The course's limited login answers wrong guesses with 401 until the budget runs out.Related terms
- 403 Forbidden — The HTTP status meaning the server knows who the caller is but that identity is not allowed to do this.
- WWW-Authenticate — The response header sent with 401 Unauthorized that tells the client which authentication scheme to use, such as Basic or Bearer.
- authentication — Establishing who a request represents, for example by checking a password, a session cookie or a signed token.
- authentication challenge — The response telling a caller with no valid credential to authenticate, a 401 status with a WWW-Authenticate header.
- 429 Too Many Requests — The HTTP status meaning the caller has sent too many requests in a given time and should slow down.
Taught in
- Remote Servers And Trust — AI Engineering: LLM Apps, RAG & Agents
- Cookies And CORS — Modern API Architecture: REST, GraphQL & gRPC
- Basic Auth, Tokens And Sessions — Modern API Architecture: REST, GraphQL & gRPC
- JSON Web Tokens — Modern API Architecture: REST, GraphQL & gRPC
- Scopes And Key Rotation — Modern API Architecture: REST, GraphQL & gRPC
- Webhooks Versus Polling — Modern API Architecture: REST, GraphQL & gRPC
- Role-Based and Policy-Based Authorization — Modern .NET Core, C# & Enterprise Microservices
- Rate Limiting And Resource Consumption — Application Security & Threat Modeling for Engineers