question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why getKey doesn't get called?

See original GitHub issue

If jwt.verify is called asynchronous, secretOrPublicKey can be a function that should fetch the secret or public key

I have following function:

const client = jwksClient({
  jwksUri: `${process.env.AUTH0_DOMAIN}/.well-known/jwks.json`
});
const getKey = (header, cb) => {
  client.getSigningKey(header.kid, (err, key) => {
    var signingKey = key.publicKey || key.rsaPublicKey;
    cb(null, signingKey);
  });
};

const result = new Promise((resolve, reject) => {
      jwt.verify(token, getKey, options, (err, decoded) => {
        if (err) {
          console.log("token verification failed:", err.message);
          reject(err);
        } else {
          resolve(decoded);
        }
      });
    });

Any idea why getKey doesn’t get called?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
sebkcommented, Dec 13, 2018

I have the same problem, that getKey isn’t called. I tried adding various console.log statements, but the implementation for getKey is not executed. I also tried version 8.3.0 and 8.4.0.

0reactions
ziluvatarcommented, Jan 18, 2019

I downloaded your project and used one jwks url and it worked fine 🤔 If you don’t have a jwks uri you can easily remove the code calling client.getSigningKey and return a hardcoded secret, you will see it is called.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GetKeyUp does not get called sometimes. - Unity Answers
Hello Community. My problem is that sometimes the GetKeyUp does not get called! My Code: void Update(); {; if (Input.GetKeyDown(KeyCode.
Read more >
C# Unity GetKeyDown() not being detected properly
GetKeyDown() only returns true for the single Update call made as soon as the key changes state. Because FixedUpdate runs at a regular...
Read more >
Scripting API: Input.GetKey - Unity - Manual
Returns true while the user holds down the key identified by name . GetKey will report the status of the named key. This...
Read more >
IDBIndex.getKey() - Web APIs - MDN Web Docs
openCursor except that the returned records are sorted based on the index, not the primary key. myIndex.getKey('Bungle') is then used to ...
Read more >
Input.GetKeyDown need to press button more than once to work
You need to call this function from the Update function, since the state gets reset each frame. It will not return true until...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found