Skip to content

Integer precision loss when decoding JWT payload JSON #54

@chenxuyuan1997

Description

@chenxuyuan1997

When decoding a JWT with large integer values in the payload, precision may be lost due to how encoding/json parses numbers by default (as float64). I noticed that the JWT library already provides an option to avoid this issue via the jwt.WithJSONNumber() parser option.
https://github.com/golang-jwt/jwt/blob/main/parser_option.go#L23.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions