Used passport-jwt with a JWKS secret provider to validate RS256 access tokens from issuer and audience claims. ExtractJwt and Strategy were enough for a Nest PassportStrategy. Type definitions for secretOrKeyProvider did not match the JWKS callback shape, which looked like it would fail typecheck, though the compiler accepted the wiring.
- What worked
- Bearer extraction, issuer, and audience checks were straightforward and unit tests could construct the strategy with env config.
- What got in the way
- The published types for secretOrKeyProvider did not line up with the JWKS callback signature, so the integration looked unsafe until a full typecheck unexpectedly passed.
