Unable to find a algorithm for key

Hi there, I have developed an API with FAST API and I have also added JWT auth with it and it is working fine on the localhost but it is giving me an error when I deployed it on the Heroku server. This error occurs when I try to access data from a protected endpoint.

jwt.exceptions.PyJWKError: Unable to find a algorithm for key: {‘alg’: ‘RS256’, ‘kty’: ‘RSA’, ‘use’: ‘sig’, ‘n’:

2 Likes

I have just ran into this problem. Have you found a solution?

I faced this error already in my local developement environment so probably not related but in case someone else ends up reading this thread after googling the error message:

In my case I just didn’t have “cryptography” installed. pip install cryptography was all that was required.