Giter Site home page Giter Site logo

Promise Methods about node-jwks-rsa HOT 8 CLOSED

auth0 avatar auth0 commented on June 19, 2024 65
Promise Methods

from node-jwks-rsa.

Comments (8)

the-architect avatar the-architect commented on June 19, 2024 3

Just found out about this, so maybe someone else can use it too.

You can promisify callback methods like this:

const { promisify } = require("util");
const jwksClient = require("jwks-rsa");

...

const client = jwksClient({ <yourOptions> });

// promisify the function:
const getSigningKey = promisify(client.getSigningKey);

// use it like any other promise:
const key = await getSigningKey(kid);

from node-jwks-rsa.

dmi3y avatar dmi3y commented on June 19, 2024 2

There is https://github.com/aneilbaboo/node-jwks-rsa-promisified

from node-jwks-rsa.

cocojoe avatar cocojoe commented on June 19, 2024 1

Agreed, sorry about that. The bot appears to be a little over zealous in its desire to close issues.

from node-jwks-rsa.

stale avatar stale commented on June 19, 2024

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. If you have not received a response for our team (apologies for the delay) and this is still a blocker, please reply with additional information or just a ping. Thank you for your contribution! 🙇‍♂️

from node-jwks-rsa.

shellscape avatar shellscape commented on June 19, 2024

@joshcanhelp aggressive bot is overly aggressive. please don't dismiss my issue and the 18 upvotes this issue received.

from node-jwks-rsa.

shellscape avatar shellscape commented on June 19, 2024

Thank you for the re-open.

from node-jwks-rsa.

vinerich avatar vinerich commented on June 19, 2024

I know this is a node library but I'd also like to be able to use this on frontend sites to verify tokens.

The next part can be wrong, only starting with js in browsers so correct me here:

  • Through the callbacks setImmediate() is used, which is supported by node but not by browsers.
  • This is not supported in any browser except Microsofts IE/Edge https://caniuse.com/#feat=setimmediate.

So please don't just promisify the existing callbacks, since this will not change the call to setImmediate().

from node-jwks-rsa.

ken5scal avatar ken5scal commented on June 19, 2024

I'm experiencing the same behavior in spa as @vinerich described.

from node-jwks-rsa.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.