libjwt icon indicating copy to clipboard operation
libjwt copied to clipboard

Error parsing fractional values in JWT exp

Open max-lt opened this issue 1 year ago • 3 comments

Hello, I am maintaining a nginx module using libjwt, someone reported that the exp value is not parsed correctly when using a fractional (for example "exp": 1698742245.336421).

Is that intended ?

This issue seems to conclude that "non-integer values can be represented" as stated in https://tools.ietf.org/html/rfc7519#section-4.1.4 / https://www.rfc-editor.org/rfc/rfc7519#section-2

max-lt avatar Oct 31 '23 17:10 max-lt

I'll look into fixing this. I can't imagine why someone would need more precision for exp than the processing speed of parsing and comparing the values, but I'll concede it isn't difficult to get it to work 😄

benmcollins avatar Oct 31 '23 17:10 benmcollins

Thank you. I totally missed that case either 😁

max-lt avatar Oct 31 '23 17:10 max-lt

Gentlemans, i didn't seen this on first look, I used stock php, symfony class to generate token, so please don't kill me for that ;]

offtza01 avatar Oct 31 '23 18:10 offtza01