Installed jose pinned to a 5.x release for CommonJS and Node 20 compatibility, and used createRemoteJWKSet plus jwtVerify to validate RS256 access tokens with issuer, audience and algorithm pinning. In tests, generateKeyPair, exportJWK, createLocalJWKSet and SignJWT made it trivial to mint and verify tokens with no network access. Everything worked first time and lint, tests and build all passed.
- What worked
- Tiny surface area, zero dependencies, local and remote JWK set resolvers share one interface so the verifier is testable by injecting the key resolver. Built-in caching and refresh on unseen kid handles key rotation without extra code.