You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
failed to generate token and throw exception secretOrPrivateKey has a minimum key size of 2048 bits for RS256. this issue only happen when running inside docker alpine (FROM node:18.14-alpine3.17) normal run on my local
conioX
changed the title
secretOrPrivateKey has a minimum key size of 2048 bits for RS256 after upgrade to nest/jwt 10.0.2
secretOrPrivateKey must be an asymmetric key when using RS256 after upgrade to nest/jwt 10.0.2
Mar 6, 2023
conioX
changed the title
secretOrPrivateKey must be an asymmetric key when using RS256 after upgrade to nest/jwt 10.0.2
secretOrPrivateKey has a minimum key size of 2048 bits for RS256 after upgrade to nest/jwt 10.0.2
Mar 6, 2023
if (!options.allowInsecureKeySizes &&
!header.alg.startsWith('ES') &&
secretOrPrivateKey.asymmetricKeyDetails !== undefined && //KeyObject.asymmetricKeyDetails is supported in Node 15+
secretOrPrivateKey.asymmetricKeyDetails.modulusLength < 2048) {
return failure(new Error(`secretOrPrivateKey has a minimum key size of 2048 bits for ${header.alg}`));
}
i think we need increae the key size or we can change to another algorithm like es256
Is there an existing issue for this?
Current behavior
failed to generate token and throw exception secretOrPrivateKey has a minimum key size of 2048 bits for RS256. this issue only happen when running inside docker alpine (FROM node:18.14-alpine3.17) normal run on my local
Minimum reproduction code
Sorry repo in my company git
Steps to reproduce
upgrade package.json like below :
"@nestjs/jwt": "10.0.2"
"passport-jwt": "^4.0.1",
"@types/passport-jwt": "^3.0.8",
Expected behavior
normal like "@nestjs/jwt": "9.0.0",
Package version
10.0.2
NestJS version
9.3.9
Node.js version
18.14
In which operating systems have you tested?
Other
No response
The text was updated successfully, but these errors were encountered: