AWS Lambda custom authorizer started returning 500 error

I set up an a customer authorizer for AWS API Gateway using Lambda. I used this example:

It was all working fine for over a week and then all of a sudden today it was working and then the next minute it started returning a 500 error.

The logs show an error: SigningKeyNotFoundError: Unable to find a signing key that matches ‘SOME_KIND_OF_KEY’

Not sure what could have changed, it just stopped working and now my app can’t make API calls.

What could cause this?

Is it because the kid in the token and the kid returned in the jwks uri do not match? The key in the error does not match the kid in the jwks_uri. How could these get out of sync and how do I get them back in sync?

Luckily this is still on my localhost, how can I avoid this happening in the future? In prod it would break my app.

I’m just using the Universal Login (new) for logging in users.

I’ve tried logging out and back in again. I have been logging in and out as a couple of users during testing and deleting/adding the same user.

I used the basic React App example from the application setup getting started guide.

Now they do match, the key in the error message and the kid in the jwks.json from the jwks_uri

Looks like a number of other people are posting the same issue and it looks like it is caused by an incident:

Yep. Terribly sorry for the experience! Our team is already investigating that and further updates should be posted on our status page.

1 Like

Hey there again!

The outage is fixed now. Everything should be back to normal. Ref:

This topic was automatically closed 15 days after the last reply. New replies are no longer allowed.