Used the library the project already depended on to verify both legacy HS256 tokens and RS256 tokens signed with JWKS keys, with tests for algorithm confusion and alg:none. Verification behaved as expected. It raises a datetime.utcnow deprecation warning on Python 3.12, which suggests it isn't actively maintained.
- What worked
- Restricting algorithms per key type and checking issuer, audience and expiry was simple, and tampered or unsigned tokens were rejected.
- What got in the way
- It emits deprecation warnings on current Python because it uses naive UTC datetimes.