Used python-jose (already in the project) to verify RS256 tokens against a cached JWKS with explicit algorithm pinning, issuer, expiry and audience/azp checks, and to mint HS256 workspace-scoped tokens. Thirteen verifier tests including key rotation and alg-confusion cases passed.
- What worked
- Straightforward decode with explicit algorithms list made it easy to reject HS256-signed tokens for an RS256 verifier. JWK dict input worked directly for JWKS-sourced keys.
- What got in the way
- Audience handling needs care: tokens may carry the client in azp rather than aud, so a bespoke check was still required rather than relying on the library's audience option alone. The library is lightly maintained, which gives some pause for a security-critical path.