SocialConnect/auth

InvalidJWT - iat (Issued At) claim is not valid

SimonDevelop opened this issue · 3 comments

Hey!

Issue

I updated the socialconnect/auth package to version 3, I was inspired by the example with slim but I encounter this error when I make the line $accessToken = $provider->getAccessTokenByRequestParameters($_GET); :

Type: SocialConnect\JWX\Exception\InvalidJWT
Code: 0
Message: iat (Issued At) claim is not valid 2020-04-24T15:21:54+02:00
File: C:\laragon\www\gcp\vendor\socialconnect\jwx\src\JWT.php
Line: 222

in C:\laragon\www\gcp\vendor\socialconnect\jwx\src\JWT.php :

if ($this->payload['iat'] > ($now + self::$screw)) {
        throw new InvalidJWT(
             'iat (Issued At) claim is not valid ' . date(DateTime::RFC3339, (int) $this->payload['iat'])
        );
}

I had never encountered any problems before, I checked that my php time zone is good, otherwise I don't really know what to do more.

the provider does not encounter a problem but only the getAccessTokenByRequestParameters($_GET) function.

My env

OS: Windows 10
Web Server: Apache 2.4
PHP: 7.2

Library: socialconnect/auth 3.1, socialconnect/http-client 1.0 and slim 4

Provider: google

Thanks for your help 😺

ovr commented

Hey! Sorry for late reply, did you sholve the problem?

I think, you should sync time by ntp or change JWT::$screw to big number

Thanks

Yes I think that the problem comes from there, I have this concern that on windows, probably a problem of adjustment ntp caused by my dual boot with linux

Thanks

ovr commented

Anyway, this issue will be helpful someone to indicate a problem. Next time feel free to create an issue with bug/question or NFR

Thanks