-
Notifications
You must be signed in to change notification settings - Fork 236
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
Axios cookiejar support error #215
Comments
I can reproduce the issue in my main.ts if I use the same approach as you here: https://github.com/auth0/node-jwks-rsa/blob/master/src/wrappers/request.js#L6 That is, simply importing request from axios:
Also fails with:
If I instead do the following, then it works fine:
It seems related to be the (new?) idiomatic way to use Axios: https://github.com/axios/axios#note-commonjs-usage. |
I think that I've understood where this is coming from. In my app, I use nano, which has recently switched to Axios and has added cookie support through axios-cookiejar-support. Unfortunately, this causes side-effects. I think that the axios-cookiejar-support library shouldn't crash and burn, so node-jwks-rsa wouldn't need to change. Meanwhile, it might be useful for this library to use the idiomatic way to use Axios so that app-specific customizations are taken into account. |
@dsebastien thanks for the investigation and the PR. We want to move away from axios, and any specific request library, and instead use node internals, while allowing for consumers of the library to completely replace how the request is made with a We could patch 1.x with your PR #216, but let me know if you find it necessary. |
Good to know; it seems like a good move forward. I'm stuck with this issue at the moment, so I've locally worked around the issue by modifying the code under node modules. If you could release a minor version with the PR that I've sent, it would be great & would allow me to move forward, while waiting for #218 to land and a larger release to come out. |
Hello @davidpatrick , I had the same problem as dsebastien with the same environment and I am stuck. it will be great if i can have the patch for the suggested solution please. |
Hey @houssembenarbia, I'll be releasing a new 1.x patch today. Thanks for raising |
Describe the problem
I'm currently trying to integrate Auth0 with my NestJS application. While following one of the tutorials, I've created a Passport strategy to handle JWT tokens.
That strategy uses jwks-rsa and the
passportJwtSecret
function. I've pointed it to the jwks.json file on my Auth0 tenant, but at runtime it seems to fail to retrieve the JWKS file.It fails with this error:
Apparently it's due to an issue between axios-cookiejar-support & Axios, which I don't really understand.
I'm posting the issue here because I don't know where to start looking, and my use case is about JWKS and not Axios. I looked at the issue trackers of both projects and couldn't find any similar issue there.
I've tried adding both axios & axios-cookiejar-support to my package.json file, but it didn't help.
What was the expected behavior?
No error ;-)
Reproduction
It's hard for me to provide a reproduction at this point. I hope that the description will suffice.
Environment
The text was updated successfully, but these errors were encountered: