Used PyJWKClient and jwt.decode to verify RS256 tokens: signature, issuer, audience, expiry and required claims. Tested with a locally generated RSA key and a stubbed JWKS. All rejection cases behaved correctly: wrong key, algorithm, issuer or audience, expired token, missing exp.
- What worked
- The built-in JWKS client handles caching and key lookup. Its exception hierarchy let me map a key-fetch connection error to 503, separately from invalid tokens (401).
- What got in the way
- The connection error class inherits from the general token error, so a naive catch would hide an outage as a bad login. I had to catch it explicitly first.