You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
return jwt.generate_jwt(payload, private_key, "RS256", exp)
File "/Users/guyma/development/firebase-poc/venv/lib/python3.10/site-packages/python_jwt/__init__.py", line 91, in generate_jwt
token.add_signature(priv_key, protected=header)
File "/Users/guyma/development/firebase-poc/venv/lib/python3.10/site-packages/jwcrypto/jws.py", line 540, in add_signature
sig = c.sign()
File "/Users/guyma/development/firebase-poc/venv/lib/python3.10/site-packages/jwcrypto/jws.py", line 149, in sign
raise ValueError('key is not a JWK object')
ValueError: key is not a JWK object```
**I managed to solve it locally by replacing line 104~ in pyrebase.py**
from: `private_key = RSA.importKey(self.credentials._private_key_pkcs8_pem)`
to: `private_key = jwk.JWK.from_pem(str.encode(self.credentials._private_key_pkcs8_pem))`
Thank you!
---
Make sure these boxes are checked before submitting your issue:
[V] Check that your version of Python is 3.4+
[V] Check that you are on the newest version of Pyrebase
[V] Check that Email/password provider is enabled in your Firebase dashboard under Auth -> Sign In Method.
Please don't be discouraged if you do not get a response to your issue quickly,
I maintain Pyrebase for fun and don't always have as much free time as I'd like.
Thank you for helping make Pyrebase better!
The text was updated successfully, but these errors were encountered:
Hey,
First, thanks for pyrebase.
I was getting the following error/logtrace :
The text was updated successfully, but these errors were encountered: