File ".../lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/grant_types/refresh_token.py", line 62, in create_token_response
token = token_handler.create_token(request,
File ".../lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/tokens.py", line 315, in create_token
'access_token': self.token_generator(request),
File ".../lib/python3.9/site-packages/drf_social_oauth2/__init__.py", line 23, in generate_token
from jose import jwt
ModuleNotFoundError: No module named 'jose'
Installing jose explicitly:
$ poetry add jose
Using version ^1.0.0 for jose
Updating dependencies
Resolving dependencies... (5.6s)
Writing lock file
Package operations: 2 installs, 0 updates, 0 removals
• Installing pycrypto (2.6.1)
• Installing jose (1.0.0)
New error:
File ".../lib/python3.9/site-packages/oauthlib/oauth2/rfc6749/tokens.py", line 315, in create_token
'access_token': self.token_generator(request),
File ".../lib/python3.9/site-packages/drf_social_oauth2/__init__.py", line 23, in generate_token
from jose import jwt
File ".../lib/python3.9/site-packages/jose.py", line 546
print decrypt(deserialize_compact(jwt), {'k':key},
^
SyntaxError: invalid syntax
Thank you for your issue. You are completely right. I forgot to add the python-jose (not jose) to the setup.py file. Would you be kind and open a pull request with the changes?
Installation:
In settings:
Make request to /social/convert-token/:
Error:
Installing jose explicitly:
New error:
After investigations, I found python-jose:
Now it works as expected.