Invalid signature after migrating to SDK JWT (v2.9.7)

In your code, for iat you subtract 30 seconds. In my case it’s 420.
For exp, I add a bit more than 2h. You can multiple by 4 instead of 2 just for testing.

Here is the working PHP code for generating signature:

use Nowakowskir\JWT\JWT;
use Nowakowskir\JWT\TokenDecoded;

//...

$iat =  time() - 420;
		
$tokenDecoded = new TokenDecoded([
    'sdkKey' => '<your sdk key>',
    'mn' => '<your meeting number>',
    'role' => 0, // or 1 depending on your needs
    'iat' => $iat,
    'exp' => $iat + 17200,
    'apiKey' => '<your sdk key>',
    'tokenExp' => $iat + 17200,
], [
	'typ' => 'JWT'
]);

$signature = $tokenDecoded
	->encode('<your sdk secret>', JWT::ALGORITHM_HS256)
	->toString();

//...

@JackYang