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

Handle error: NameError: name 'SignatureExpired' is not defined #5

Merged
merged 2 commits into from
Aug 25, 2020

Conversation

andrewrfreed
Copy link

@andrewrfreed andrewrfreed commented Aug 8, 2020

Error handling appears to fail during invalid cookie due to missing import.

I have itsdangerous 1.1.0 installed in pip3 but still get the error. Fixing the import should solve that.

Received this error:

NameError
NameError: name 'SignatureExpired' is not defined

Traceback (most recent call last)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_oidc_ext/__init__.py", line 375, in _get_cookie_id_token
return self.cookie_serializer.loads(id_token_cookie)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/itsdangerous/jws.py", line 143, in loads
self.make_signer(salt, self.algorithm).unsign(want_bytes(s)),
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/itsdangerous/signer.py", line 169, in unsign
raise BadSignature("Signature %r does not match" % sig, payload=value)
During handling of the above exception, another exception occurred:
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 1948, in full_dispatch_request
rv = self.preprocess_request()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask/app.py", line 2242, in preprocess_request
rv = func()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_oidc_ext/__init__.py", line 437, in _before_request
self.authenticate_or_redirect()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_oidc_ext/__init__.py", line 457, in authenticate_or_redirect
id_token = self._get_cookie_id_token()
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/flask_oidc_ext/__init__.py", line 376, in _get_cookie_id_token
except SignatureExpired:
NameError: name 'SignatureExpired' is not defined
The debugger caught an exception in your WSGI application. You can now look at the traceback which led to the error.
To switch between the interactive traceback and the plaintext one, you can click on the "Traceback" headline. From the text traceback you can also create a paste of it.

Brought to you by DON'T PANIC, your friendly Werkzeug powered traceback interpreter.

DCO 1.1 Signed-off-by: Andrew R. Freed afreed@us.ibm.com

@andrewrfreed
Copy link
Author

Updated PR with additional perceived syntax errors in error handling

@Apexal
Copy link

Apexal commented Aug 18, 2020

I'm also getting this error, hope this can be merged soon!

@svintit
Copy link
Owner

svintit commented Aug 25, 2020

Sorry about the delay here, this lgtm, merging and will do a release soon.

@svintit svintit merged commit c09ebf8 into svintit:master Aug 25, 2020
@svintit
Copy link
Owner

svintit commented Aug 26, 2020

@Apexal @andrewrfreed released: https://pypi.org/project/flask-oidc-ext/1.4.3/

@andrewrfreed
Copy link
Author

Thanks @svintit for the merge and release!

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

Successfully merging this pull request may close these issues.

3 participants