Failed to join in a meeting. Invalid signature for zoom websdk 2.17

Showing in a popup “Failed to join in a meeting. Invalid signature” for zoom websdk 2.17
Tried almost every possible ways

  1. Generating jwt signature with sdk & secret key from backend using cakephp (php version 7.4 )
  2. Also used custom jwt code for generating signature.
  3. Also increased expiry time to 10 hrs difference while sending request to zoom for generating signature below payload
    ‘sdkKey’ => $sdkKey,
    ‘mn’ => $meetingNumber,
    ‘role’ => $role,
    ‘iat’ => $iat,
    ‘exp’ => $exp,
    ‘tokenExp’ => $exp

Also cross verified the generated signature using jwt.io decoded payload exactly matches with credentials

Need help for Below configuration:-
Backend environment: PHP 7.*
Framework: CakePHP 3.*
ZoomWebSDK version 2.17

No solution found for the above configuration in your official forum.
Any help would be appreciated!

@arnab , could you share a sample of your JWT token here?

@chunsiong.zoom Please find below the sample of JWT token/signature created yesterday:

[REDACTED]

@arnab I’ll PM you for additional troubleshooting

update: issue with generating signature.

Solution, php to generate code shared below

<?php
// Step 1: Include Composer's autoload.php
require 'vendor/autoload.php';

// Step 2: Import the Firebase JWT class
use Firebase\JWT\JWT;


$config = include 'config.php';
$meetingSDKClientKey=$config['meetingSDKClientKey'];
$meetingSDKClientSecret= $config['meetingSDKClientSecret'];


$iat = time();
$exp = $iat + 60 * 60 * 2;
$token_payload = [

    'sdkKey' => $meetingSDKClientKey,
    'mn' => 123123123,
    'role' => 1,
    'iat' => $iat,
    'exp' => $exp,
    'tokenExp' => $exp
];

$jwt = JWT::encode($token_payload, $meetingSDKClientSecret, 'HS256');
echo $jwt;

?>