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

token validation fails with pyjwt>=2.10 #51

Open
simontaurus opened this issue Nov 30, 2024 · 0 comments · May be fixed by #52
Open

token validation fails with pyjwt>=2.10 #51

simontaurus opened this issue Nov 30, 2024 · 0 comments · May be fixed by #52

Comments

@simontaurus
Copy link

mediawiki uses numerical values for subjects, e.g. "sub": 4.

Since version 2.10 pyjwt enforces subject to be of type string, see jpadilla/pyjwt#1017

This makes jwt.decode failing with Exeption: Subject must be a string

identity = jwt.decode(r.content, consumer_token.secret,

Workaround:
Downgrage pyjwt<2.10

Solution:
set options = {"verify_sub": False} for jwt.decode

simontaurus added a commit to simontaurus/python-mwoauth that referenced this issue Dec 1, 2024
@simontaurus simontaurus linked a pull request Dec 1, 2024 that will close this issue
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 a pull request may close this issue.

1 participant