Trouble Authenticating Firebase JWTs with My Custom API

Hello,

I'm facing an issue that I've been unable to solve with online resources. I've developed my own API in python

API_Code_Send.PNG
118.39KB

and I want it to authenticate JWTs issued by Firebase before proceeding with any operations. However, I'm unsure whether the code I'm using for this purpose is correct, as I've been unable to generate a JWT that is accepted by my API. I'm not certain if the issue lies with how the JWT is being generated or with my authentication code.

Here's what I'm trying to achieve: my API needs to validate the JWT sent by the client (which is generated by Firebase Auth) before processing the request. Unfortunately, I can't seem to produce a JWT that passes this validation step.

Could anyone advise if the code I'm using to validate the JWT is correct, or if it requires adjustments? I'm not sure if the error is on the JWT generation side or if my validation code is at fault.

Thank you in advance for any help or guidance you can provide to resolve this issue.

1
1 reply