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

ImportError: cannot import name 'JSONWebSignatureSerializer' from 'itsdangerous' #147

Open
khteh opened this issue Jun 9, 2022 · 19 comments

Comments

@khteh
Copy link

khteh commented Jun 9, 2022

Python 3.10.4
pipenv, version 2022.5.2
flask-oidc 1.4.0
Exception happens on the following import line:

from flask_oidc import OpenIDConnect
@Mikaciu
Copy link

Mikaciu commented Jun 9, 2022

Hello,
This class has been removed in itsdangerous 2.1.0 : https://itsdangerous.palletsprojects.com/en/2.1.x/changes/#version-2-1-0

It was mentioned in #3 ...

In your Pipfile, could you please add itsdangerous = "<2.1" ?

@khteh
Copy link
Author

khteh commented Jun 9, 2022

How long can you stay in this deprecated functionality? Instead of going backward, this library should be updated to use proper library as described here:

https://itsdangerous.palletsprojects.com/en/2.1.x/changes/
https://docs.authlib.org/en/latest/jose/jws.html

@Mikaciu
Copy link

Mikaciu commented Jun 10, 2022

I honestly don't know, I had the same issue several days ago and thought it would be helpful to share ;)

@ecederstrand
Copy link

Apparently fixed in #144

@gcalmettes
Copy link

confirming that installing #144 fixes it.

@khteh
Copy link
Author

khteh commented Aug 6, 2022

Fixed? Install? What do you mean and how? #144 is not even merged yet!?

@gcalmettes
Copy link

gcalmettes commented Aug 6, 2022

@khteh you can install the changes introduced by #144 by specifying directly the MR or the commit you want in your pip install command.

e.g.: pip install git+https://github.com/puiterwijk/flask-oidc.git@b10e6bf881a3fe0c3972e4093648f2b77f32a97c

On our end, we are using a custom security manager for Airflow to connect using OIDC, which relies on flask-oidc underneath (https://flask-appbuilder.readthedocs.io/en/latest/security.html#authentication-openid). Because the dependency on itsdangerous is not pinned, the latest build broke the oidc workflow to connect to Airflow, but adding the latest commit of #144 as dependency in our docker build (command above) fixed it.

Note that pip install git+https://github.com/puiterwijk/flask-oidc.git@refs/pull/144/head as specified in #152 would also work if you don't want to freeze to a specific commit and benefit from the update made to the MR.

@khteh
Copy link
Author

khteh commented Aug 6, 2022

What stops you from merging and releasing the fix as a new version?

@gcalmettes
Copy link

@khteh well, one would need to have the proper rights on the repo for that, so this decision relies on @puiterwijk’s approval of the PR.
In the meantime targeting the code of the PR for the install is a workaround.

@khteh
Copy link
Author

khteh commented Aug 6, 2022

Ok. Thanks. BTW, what's MR?

@gcalmettes
Copy link

Sorry, I mixed the Gitlab’s way of defining things. MR = Merge request (which is Gitlab’s denomination for Pull Request).

@khteh
Copy link
Author

khteh commented Aug 6, 2022

For those using pipenv: pipenv install git+https://github.com/puiterwijk/flask-oidc.git@refs/pull/144/head#egg=flask-oidc

@marcelrend
Copy link

@puiterwijk could this PR please be merged and released?

@frafful
Copy link

frafful commented Dec 22, 2022

Are there any possible workaround this issue? It seems it will take a while to merge the fix to master.

@ecederstrand
Copy link

Yes. See #147 (comment)

pypingou pushed a commit to Pagure/pagure that referenced this issue Feb 13, 2023
'flask-oidc' 1.4.0 (latest) still use 'JSONWebSignatureSerializer' which was removed in 'itsdangerous' v2.1.
Until puiterwijk/flask-oidc#144 is merged and a new version of flask-oidc is released,
it's necessary to pin 'itsdangerous' to a version below 2.1 if 'flask-oidc' is used.

References:
puiterwijk/flask-oidc#147
https://itsdangerous.palletsprojects.com/en/2.1.x/changes/#version-2-1-0
@Nixellion
Copy link

So it's 2023, 4 months later, is this still the issue and is it not yet updated?

@nebucadnezzar
Copy link

if it fixed, why dont you get updated?

@macmule
Copy link

macmule commented May 9, 2023

Came here hoping for a fix too.

jcristau added a commit to jcristau/tooltool that referenced this issue May 29, 2023
Regenerate dependencies files with pip-compile-multi (on python 3.8);
allow Flask update since connexion was updated to not conflict, but
limit it to <2.3 since newer versions pull in a version of werkzeug
that's incompatible with connexion
(https://github.com/spec-first/connexion/blob/2.14.2/setup.py#L28).
Also constrain the version of itsdangerous because of
puiterwijk/flask-oidc#147.
jcristau added a commit to mozilla-releng/tooltool that referenced this issue Jun 13, 2023
Regenerate dependencies files with pip-compile-multi (on python 3.8);
allow Flask update since connexion was updated to not conflict, but
limit it to <2.3 since newer versions pull in a version of werkzeug
that's incompatible with connexion
(https://github.com/spec-first/connexion/blob/2.14.2/setup.py#L28).
Also constrain the version of itsdangerous because of
puiterwijk/flask-oidc#147.
@frozenpandaman
Copy link

Still waiting on a fix…

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

10 participants