-
-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Migrating from python-jose #25
Comments
I've used def validate(public_key: jwk.RSAKey, token: str) -> bool:
try:
jwt.decode(token, public_key)
except BadSignatureError:
return False
except JoseError:
raise # This will hit if, for instance, the token is an invalid token
else:
return True This will just validate the signature. I combine this with a |
@swails is correct. It would be great if you can show me how are you using |
The title of this issue is sufficient for me to share some of my migration experience from python-jose, so I'll just drop them here.
|
thanks @swails. That helped a lot to straighten my spaghetti approach :-) I will add also
|
Currently doing migration from python-jose to joserfc and found myself in a bit of a pickle.
python-jose implementation allows validation of the token against the public_key (using verify method from RSAKey https://github.com/mpdavis/python-jose/blob/master/jose/backends/rsa_backend.py#L206).
As our codebase does that I was looking for a way to achieve the same with joserfc but the only reference to RSAKey verification I found in the docs was in https://jose.authlib.org/en/guide/jwk/#options
where I can pass additional parameters to the
RSAKey.import_key
but it does not explain exactly how does the verification works. Could you shed some additional light on how to approach this issue?here's a pseudo code
The text was updated successfully, but these errors were encountered: