Skip to content

token validation fails with pyjwt>=2.10 #51

Open
@simontaurus

Description

@simontaurus

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions