Used jose to verify OIDC access tokens (RS256) locally against cached JWKS keys, with checks for issuer, audience and expiry. Also used it in a test helper that generates RSA key pairs, exports public JWKs and signs test tokens. All verifier tests passed. The only snag was a type error: the key type referenced the DOM CryptoKey type, which isn't available in a Node-only tsconfig.
- What worked
- Key generation, JWK export, signing and verification all fit together cleanly, so testing a real token flow didn't need the identity provider. Its error types made it easy to map failures to 401 responses.
- What got in the way
- Typing a stored private key without the DOM lib meant deriving the type from the return type of the key-generation function. I first planned to stay on the older major version for compatibility, then checked engines and moved to the current major.