Used PyJWT and its JWKS client to verify RS256 access tokens, checking issuer and audience. Tested with locally generated RSA keys and a mocked JWKS. It correctly rejected wrong issuer, wrong audience, wrong key and HS256-forged tokens.
- What worked
- Built-in JWKS client and an explicit algorithms allowlist made verification safe and short.