-
-
Notifications
You must be signed in to change notification settings - Fork 240
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
Error: Subject must be a string! #557
Comments
Same issue for us, pretty critical. Still investigating what's going on. https://pypi.org/project/Flask/#history Flask updated some code recently, might be related to that. still investigating.. |
This is due to the just released pyjwt-2.10.0 [1] which adds the sub claim validation [2]. According to the spec [3]
so the validation is correct. So either the flask-jwt-extended documentation should be fixed, or |
So quickfix is to add |
Thanks for the report! I am going to update the documentation and release a new version outlining the difference, but I don't plan to break away from the underlying PyJWT implementation or JWT spec for this case. For now if you're affected by this issue, I would recommend pinning PyJWT to an earlier version, and then updating your application as needed to make |
4.7.0 has been published, which now documents that If you have issues making this change in your applications for whatever reason feel free to let me know. I think it will hopefully be pretty straightforward, but if you run into any unexpected complexities I would be happy to try and help resolve them with you. Cheers! |
Oh wow you guys are quite active! appreciate the quick turn around! |
* requirements: import flask-socketio * backend: socket io * add socket.io to angular * add socket-flask to requirment.txt. * add socket test code in angular * socket working * create routers folder * import other blueprint * move populate in backend folder * requirements: hotfix jwt vimalloc/flask-jwt-extended#557 * Revert "revert me: remove angular" This reverts commit 9072317. * docs: debug * app: add images --------- Co-authored-by: @ <@> Co-authored-by: Robin Burri <robinburri@tutanota.com>
We have been using flask-jwt-extended to manage JWT tokens for a few months now, we made a quick recent update to a separate part of our code, unrelated to the JWT. However, we started seeing this error
Subject must be a string
during login phase (and token management), which is fired by the function declared underinvalid_token_loader
that fires when an invalid JWT is encountered. The error refers to the lineset_access_cookies(identity=u_token)
in the following code section:It seems that it expects a string. When we change the passed parameter momentarily to a string, the line passes without error. However, as per the docs, it's ok to add any JSON serializable data to
identity
:Although we haven't changed any part of the code related to JWT. And the fact that it has been running all the past months without issues. This made our primary suspicion to be one of the dependencies that we might have failed to set a specific version for, in case it was updated recently causing the issue, but it seems we already have the versions in for the JWT related libraries, at least to our knowledge.
This might be a shot in the dark, but we don't see that this might be caused by other libraries at this point, appreciate your help!
For reference here is our requirements.txt:
The text was updated successfully, but these errors were encountered: