jwt decode() errror

559 views
Skip to first unread message

Jacinto Parga

unread,
Feb 28, 2021, 3:07:36 PM2/28/21
to py4web
Hello,

I get this error in suth login with mysql db . Any idea?

ERROR:root:Traceback (most recent call last):
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/core.py", line 781, in wrapper
2021-02-28 20:55:52.709 ∅∅∅
ret = func(*func_args, **func_kwargs)
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/core.py", line 735, in wrapper
2021-02-28 20:55:52.709 ∅∅∅
ret = func(*args, **kwargs)
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/utils/auth.py", line 742, in _
2021-02-28 20:55:52.709 ∅∅∅
return plugin.handle_request(self, path, request.query, request.json)
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/utils/auth_plugins/__init__.py", line 31, in handle_request
2021-02-28 20:55:52.709 ∅∅∅
self._handle_callback(auth, get_vars)
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/utils/auth_plugins/__init__.py", line 41, in _handle_callback
2021-02-28 20:55:52.709 ∅∅∅
data = self.callback(get_vars)
2021-02-28 20:55:52.709 ∅∅∅
File "/srv/lib/py4web/utils/auth_plugins/__init__.py", line 164, in callback
2021-02-28 20:55:52.709 ∅∅∅
data = jwt.decode(token, verify=False)
2021-02-28 20:55:52.709 ∅∅∅
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/api_jwt.py", line 113, in decode
2021-02-28 20:55:52.709 ∅∅∅
decoded = self.decode_complete(jwt, key, algorithms, options, **kwargs)
2021-02-28 20:55:52.709 ∅∅∅
File "/layers/google.python.pip/pip/lib/python3.8/site-packages/jwt/api_jwt.py", line 79, in decode_complete
2021-02-28 20:55:52.709 ∅∅∅
raise DecodeError(
2021-02-28 20:55:52.709 ∅∅∅
jwt.exceptions.DecodeError: It is required that you pass in a value for the "algorithms" argument when calling decode().
2021-02-28 20:55:52.709 ∅∅∅

Thanks

Kevin Keller

unread,
Feb 28, 2021, 3:09:12 PM2/28/21
to Jacinto Parga, py4web
Can you downgrade your pyjwt from 2.0 to 1.7 please and see if that helps. 


cloudHQPowered by
cloudHQ

--
You received this message because you are subscribed to the Google Groups "py4web" group.
To unsubscribe from this group and stop receiving emails from it, send an email to py4web+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/py4web/c8738d8f-7e52-4b87-9a0e-7a972663af20n%40googlegroups.com.

Andrew Gavgavian

unread,
Feb 28, 2021, 3:16:40 PM2/28/21
to Kevin Keller, Jacinto Parga, py4web
I really hate this about JWT. I think we should change the restriction in requirements.txt to either only allow <2.0, or >2.0 because of how different it is between versions. Either way should be standardized and works across the program.

This was discussed some more in another thread (Many examples broken due to URL Signer Error) and is something that should be discussed more across the group.

~Andrew

Jacinto Parga

unread,
Mar 1, 2021, 2:46:33 AM3/1/21
to py4web
Yes, thankyou Andrew.

It was solved just setting PyJWT == 1.7.1  in the requirements.txt file.

And I agree with you about getting rid off the dependencies that cause errors with newer versions.

Best

Reply all
Reply to author
Forward
0 new messages