Skip to content

Wrong type of exception raised if required claim is missing in jwt.decode #197

Open
@akikoskinen

Description

@akikoskinen

The documentation of jwt.decode says:

Raises:
JWTError: If the signature is invalid in any way.
ExpiredSignatureError: If the signature has expired.
JWTClaimsError: If any claim is invalid in any way.

When an explicitly required claim (one where options["require_XXX"] is set to True) is missing, a JWTError is raised. I think the implementation and the documentation contradict. I like what the documentation says, and wish that the implementation would deliver. So in this case I hope it would raise a JWTClaimsError.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions