HTTP Authentication Understand the exchange01 / 04

SECTION 01 · 6 MIN READ & EXPLORE

Follow the request

Before learning the methods, watch the conversation between a client and a server.

DEMONSTRATION CONTENT

Authentication starts with a question: who is making this request? Authorization asks what that identity is allowed to do. Keep those two questions separate as you explore.

One request, a small conversation

A protected endpoint can respond to a request without credentials with 401 Unauthorized and a WWW-Authenticate header. That header describes an authentication challenge. A client can then retry with an Authorization header.

A client requests a protected resource, receives a 401 challenge, retries with credentials, and receives a successful response.

This diagram is a simplified challenge-response flow. Some clients send credentials immediately, and token-based systems often obtain their credentials through a separate exchange.

READ Read the overview

HTTP authentication — MDN (opens in a new tab)

Focus on the general framework and challenge headers. Skip the catalogue of schemes for now; first get comfortable reading the conversation.

Inspect before guessing

When a request fails, record its status, challenge, and response body before changing your configuration. 401 commonly points toward missing or invalid authentication; 403 indicates the server refuses the request. Real systems can deliberately obscure details, so always consider the API’s documented behavior.

Before you move on

Explain what WWW-Authenticate communicates. Then explain why a valid identity does not automatically have permission to access every resource.

A LITTLE CLEARER?

Take a moment to explain the idea in your own words.

Progress is saved in this browser.

HTTP Authentication

Course overview ↗

01Understand the exchange

  1. Follow the request6m