requests / requests-oauthlib

OAuthlib support for Python-Requests!
https://requests-oauthlib.readthedocs.org/
ISC License
1.72k stars 424 forks source link

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

Open beckygroves opened 3 years ago

beckygroves commented 3 years ago

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 commented 3 years ago

can you add the output from pip freeze

gmishkin commented 1 year ago

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