Description
The default timestamp uses time()
which just has second precision.
Some OAuth-Servers/Providers - like Laravels passport (with thephpleague-server and Carbon2) / lcobucci - issue tokens with microsecond precision in the iat/nbf fields.
If such a token is validated with this lib in standard-configuration the same second (of course after) it is issued, validation will wrongly fail with the Cannot handle token prior to
error (without systemclock skew), as $payload->iat > ($timestamp )
e.g. 1676279484.234102 > 1676279484
albeit the time of validation is e.g. 1676279484.7 or 1676279484.4 .
This can be mitigated by setting a $leeway of 1 second of course.
I think however the validation should be enhanced by either rounding or using a microtime()-stamp.
Line 96 in 4dd1e00
Edit: May also apply to the nbf check - which is often also set to the issuance date