x-api-key: 12345. The server checks its database: "Does key 12345 exist? Yes, it belongs to Alice." -> Alice is Authenticated.DELETE /users/bob.| Feature | Authentication (AuthN) | Authorization (AuthZ) |
|---|---|---|
| Question | Who are you? | What are you allowed to do? |
| Timing | Comes first. | Comes after authentication. |
| Mechanism | Passwords, Biometrics, API Keys. | Permissions, Roles, Scopes, Policies. |
| Failure Code | 401 Unauthorized | 403 Forbidden |
| Data Standard | OpenID Connect (OIDC), SAML. | OAuth 2.0 (Scopes). |
read:profile, write:posts).