API Testing · Junior · Question 74 of 75
What should happen when a request uses an expired token?
- 1
500, because the token can't be read any more - 2
200with data, since the user was valid before - 3
401with a clear error, and no data returned
Show the answer
Correct answer: 401 with a clear error, and no data returned
Explanation
Testers check expired, malformed, revoked and missing tokens. Each should be rejected without leaking data.