System Design · Junior · Question 8 of 75
How do 401 and 403 responses differ?
- ✓Correct answer: 401 - not authenticated, 403 - authenticated but lacking permission
- 2401 - no access rights, 403 - the user hasn't logged in at all
- 3401 - resource not found, 403 - server temporarily unavailable
Explanation
On 401, the client usually prompts the user to sign in or refreshes the token. On 403, signing in again won't help - show "access denied". 404 means the resource wasn't found (sometimes it's returned instead of 403 to avoid revealing that the resource exists).