-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Crypto - KeyObject is undefined for Node V14 - "jsonwebtoken": "9.0.0" #885
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I tripped over the same issue. I believe the problem is that KeyObject belongs to node Crypto, and so does not exist in the browser environment. |
Indeed, Versions before 9.0.0 could use webpack's polyfill of the Node.js built-in modules. This most likely a) relied on slow js cryptography that isn't maintained anymore and lacks feature parity with Node's crypto and b) increased your js bundle size considerably. FWIW webpack 5 also no longer defaults to using these questionable crypto polyfills anymore. It is better to rely on JWT modules made to be consumed in browser or generic javascript environments. You can discover such modules on jwt.io under "JavaScript" libraries. |
Node 15 implementation adds WebCrypto and CryptoKey What blocks jsonwebtoken from creating similar This library has been is much smaller package for its purpose and we like to keep using it instead of the alternatives. |
Is this repo even being maintained? |
Please do not report security vulnerabilities here. The Responsible Disclosure Program details the procedure for disclosing security issues.
Thank you in advance for helping us to improve this library! Please read through the template below and answer all relevant questions. Your additional work here is greatly appreciated and will help us respond as quickly as possible. For general support or usage questions, use the Auth0 Community or Auth0 Support. Finally, to avoid duplicates, please search existing Issues before submitting one here.
By submitting an Issue to this repository, you agree to the terms within the Auth0 Code of Conduct.
Description
Reproduction
Environment
The text was updated successfully, but these errors were encountered: