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

Python package pyjwt #35

Closed
flopp999 opened this issue Sep 1, 2021 · 4 comments
Closed

Python package pyjwt #35

flopp999 opened this issue Sep 1, 2021 · 4 comments

Comments

@flopp999
Copy link
Contributor

flopp999 commented Sep 1, 2021

Is it possible for you to change from pyjwt==1.7.1 to pyjwt>=1.7.1?

Then I can upgrade pyjwt to 2.1

https://github.com/lendy007/skodaconnect/blob/5ced4e2a1c7cfcc1c20156568df0058fbcaf7f07/requirements.txt#L5

@Farfar
Copy link
Collaborator

Farfar commented Sep 1, 2021

Is it possible for you to change from pyjwt==1.7.1 to pyjwt>=1.7.1?

Then I can upgrade pyjwt to 2.1

https://github.com/lendy007/skodaconnect/blob/5ced4e2a1c7cfcc1c20156568df0058fbcaf7f07/requirements.txt#L5

I can't remember if I tested 2.1 but versions above 1.7.1 breaks the token validation. Do you know if it's fixed in 2.1?

@flopp999
Copy link
Contributor Author

flopp999 commented Sep 2, 2021

you are right, all above 1.7.1 make skodaconnect to crash

DEBUG:skodaconnect.connection:Verifying that tokens are valid now (2021-09-02 07:23:57.072429) and at least until next poll (2021-09-02 07:28:57.072429)
Traceback (most recent call last):
File "example3.py", line 277, in
loop.run_until_complete(main())
File "/usr/lib/python3.7/asyncio/base_events.py", line 584, in run_until_complete
return future.result()
File "example3.py", line 119, in main
if await connection.doLogin():
File "/usr/local/lib/python3.7/dist-packages/skodaconnect/connection.py", line 157, in doLogin
realCars = await self.getRealCarData()
File "/usr/local/lib/python3.7/dist-packages/skodaconnect/connection.py", line 703, in getRealCarData
if not await self.validate_tokens:
File "/usr/local/lib/python3.7/dist-packages/skodaconnect/connection.py", line 1388, in validate_tokens
id_exp = jwt.decode(idtoken, verify=False).get('exp', None)
File "/usr/local/lib/python3.7/dist-packages/jwt/api_jwt.py", line 119, in decode
decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
File "/usr/local/lib/python3.7/dist-packages/jwt/api_jwt.py", line 87, in decode_complete
'It is required that you pass in a value for the "algorithms" argument when calling decode().'
jwt.exceptions.DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode().

@Farfar
Copy link
Collaborator

Farfar commented Sep 2, 2021

I will take a look at the pyJWT documents and see if I can make it work.

@Farfar
Copy link
Collaborator

Farfar commented Sep 2, 2021

Added support for pyJWT 2+ as well as backwards compability. Will be available in 1.1.0 release but available now in latest commit.

@Farfar Farfar closed this as completed Sep 2, 2021
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

2 participants