Skip to content
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

Issue with RSA signing: AttributeError: module 'jwt.algorithms' has no attribute 'RSAAlgorithm' #431

Open
beckygroves opened this issue Nov 12, 2020 · 2 comments

Comments

@beckygroves
Copy link

This is my code:

from requests import post
from requests_oauthlib import OAuth1
from oauthlib.oauth1 import SIGNATURE_RSA
oauthHeader = OAuth1(
    _CONSUMER_KEY,
    signature_type="auth_header",
   signature_method=SIGNATURE_RSA,
   rsa_key=_PRIVATE_KEY,
)
r = post(f"{_HOST}/{_TOKEN_PATH}/request-token", auth=oauthHeader)

when I run I get this error

File "/usr/local/lib/python3.6/site-packages/oauthlib/oauth1/rfc5849/signature.py", line 561, in _jwt_rs1_signing_algorithm
    _jwtrs1 = jwtalgo.RSAAlgorithm(jwtalgo.hashes.SHA1)
AttributeError: module 'jwt.algorithms' has no attribute 'RSAAlgorithm'

I have oauthlib, cryptography, and pyjwt installed :/

@jtroussard
Copy link
Contributor

can you add the output from pip freeze

@gmishkin
Copy link

I think request-oauthlib should depend on oauthlib with the signedtoken extra https://github.com/oauthlib/oauthlib/blob/564d526fdbdc32a936e4b5ddac186c26024f626b/setup.py#L40

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants