Returned error from jose.importJWK is squashed
See original GitHub issueWe had an issue where we were trying to debug the following error:
no valid key found in issuer's jwks_uri for key parameters {"kid":"jwa2A0ZH0Y4M_9HD-spX","alg":"RS256"}
The error is thrown at openid-client/lib/helpers/issuer.js:94:11.
After digging some time, I located the real source: https://github.com/panva/node-openid-client/blob/b3c0f3c5f800253dfd5fd793c63faccc0951148e/lib/helpers/keystore.js#L231
Our bug was missing “n” (modulus) and “e” (exponent) in some dev jwks keys. Because the error was squashed though, we could not see what happened.
I’ll be willing to make a PR for this if the owners agree the errors should be handled differently.
Issue Analytics
- State:
- Created 9 months ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Various issues in jwt.decode / jws._get_keys #45 - GitHub
I've had a couple issues (figuring out how to use jwt.decode) which stem from the jws._get_keys implementation. key argument must be ...
Read more >jose - npm
Implemented specs & features · JSON Web Signature (JWS) - RFC7515 · JSON Web Encryption (JWE) - RFC7516 · JSON Web Key (JWK)...
Read more >creating JWK and JWS using jose, however getting error ...
in your code you try to load a key from a keystore that you filled with your own key, but the key is...
Read more >node-jose - Cisco Developer
A JavaScript implementation of the JSON Object Signing and Encryption (JOSE) for current web browsers and node.js-based servers. This library implements ( ...
Read more >@panva/jose - npm Package Health Analysis | Snyk
JSON Web Almost Everything - JWA, JWS, JWE, JWK, JWT, JWKS for Node.js with minimal dependencies For more information about how to use...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Thats a great point, and if that is the case it would of course not make sense to throw an error. A tiny bit more info in the log would have saved my day though. I’ll leave it at that and close this issue. Others who might get the same error now has a chance of reading about it here 🙃
😄 Gladly it was some dev keys in a dev environment, not sure how they were generated, but I’ll have to look into that next.
Likewise the error from
jose
is only ever good in one scenario that you happened to fall under but would completely throw off developers in others. It is not that common that authorization servers don’t know how to well form a JWK 😉