Most auth testing stops at "a valid token works, an invalid one does not", which leaves the interesting half untested: the token that was valid when the request started and expired before it finished. The APIs below issue genuinely signed, genuinely short-lived tokens, so refresh and expiry are things that actually happen.
Real endpoints from the catalog — every request above is served, and every status code shown is one that endpoint actually returns.
How to practise it
Complete the client-credentials flow and call a protected endpoint with the token you were issued.
Wait for a short-lived token to expire and confirm your client refreshes transparently instead of failing the user's request.
Exchange a refresh token, then attempt to reuse the old one and read the rejection.
Run the authorization-code flow with PKCE, then retry with the wrong code_verifier.
Drive the device-code flow end to end — the one that matters for CLIs and TVs, and the one nobody tests.
Send a well-formed but wrongly-signed JWT and confirm it is refused as firmly as a missing one.
Test 401 vs 403 with Python
This example uses the Friends API role-based demo tokens, which are separate from the OAuth tokens issued by Auth Playground. Install requests and run it with a fresh sandbox.
The target is deliberately absent. A missing token is unauthenticated; the viewer token is authenticated but cannot delete; the admin may delete but this resource does not exist.
APIs to try it on
Friends API — Characters, episodes & quotes from the coffee-house gang. (14 endpoints)
Pagination testing — Practise page-number and cursor pagination, and the edge cases that break clients: the last partial page, an out-of-range page, and a total count that disagrees with what you collected.
Rate limit testing — Trigger a real 429 with Retry-After and X-RateLimit headers, and verify your client backs off instead of retrying straight into the limit.
Idempotency key testing — Send the same write twice with an Idempotency-Key and confirm the operation happens once — the mechanism that stops a network retry becoming a duplicate charge.
ETag and If-Match testing — Provoke a 412 Precondition Failed by writing with a stale ETag — the check that stops two clients silently overwriting each other.
Webhook signature testing — Register a callback, trigger a delivery, verify its HMAC signature, and confirm a tampered payload is rejected.
Negative testing — Provoke 400, 401, 403, 404, 409, 418, 422, 429, 500 and 503 deliberately, and check your client handles each one differently.
Async job testing — Start a long-running job, follow the 202 and its Location header, and poll to completion — including the failure and timeout paths.
LLM API testing — Test code that calls a language model — reassemble streamed answers, detect a dropped stream, honour Retry-After and complete a tool-call round trip — without a real key.
MCP client testing — Test an MCP client or agent over Streamable HTTP — initialize and session ids, tool schemas and structured output, tool errors versus protocol errors, and authentication.