I have been trying to search for last 2 days but when nothing seemed to work, I am posting here:
I need to add a Zoom app to my website (not open to everyone), where multiple hosts can create a meeting and other users who have the link can join those meetings.
There does not need to be any manual intervention to authorize the users to join or host the meeting.
I have created a developer account.
I was never really sure about where to start so,firstly, I created a normal app using Develop → Build app and used Web SDK sample, changed client_id and secret key in CDN version in index.js, and it always resulted in the signature invalid error. In any case I did not want to pass the keys, etc., on the front end, so I didn’t spend any more time on it. I am using the latest version of SDK 3.6.0 JavaScripts and CSS
Then I used just SDK JavaScript and CSS from CDN and used the above app, but was unable to create the meeting as it required ZAK.
To get the developer account ZAK details I needed an account ID. For that, I needed to have a Server to Server app, so I created one.
Now that I have ZAK using OAuth (yes, I have added type=zak), client_id and client secret for Server to Server app, I used actual user id obtained using API as well as me to get ZAK. I used those to generate signature and passed those script below. When I clicked join, I received this error:
Joining Meeting Timeout or Browser restriction
Token error
{"status":false,"errorCode":3136,"errorMessage":"Not support start meeting via tokens"}
<script>
ZoomMtg.preLoadWasm();
ZoomMtg.prepareWebSDK();
ZoomMtg.init({
leaveUrl: leave_url,
success: (success) => {
ZoomMtg.join({
sdkKey: sdk_key,
signature: signature, // 1
meetingNumber: 777777,
//password: password,
userName: user_name,
zak: zak_token, // the host's zak token
success: (success) => {
console.log(success)
},
error: (error) => {
console.log('Join error');
console.log(error)
}
})
},
error: (error) => {
console.log(error)
}
})
Errors seem to be misleading. I tried to change the signature manually, still getting the same error.
Then I used ZAK details obtained using Server to Server app AND other application’s (created using Develop → Build App) client ID, client secret, and signature created using that in the above code, but the error is still the same.
Does meeting need to be created first to start it or web SDK creates it before starting? I thought, It would be so I created the meeting and got an meeting id back along with other details.
'/v2/users/'. $user_id . '/meetings',
[
'headers' =>
[
'Content-Type' => 'application/json',
'Authorization' => 'Bearer ' . $access_token,
],
'json' => [
'topic' => 'My Meeting',
'type' => 1,
'password' => '',
'agenda' => '',
'settings' => [
'waiting_froom' => false,
'host_video' => true,
'participant_video' => true,
'join_before_host' => true,
'mute_upon_entry' => true,
'approval_type' => 0,
]
]
]
Now I am getting invalid signature.
use Firebase\JWT\JWT;
payload:
^ array:7 [
"appKey" => "svIaz69U...."
"sdkKey" => "svIaz69U....."
"mn" => 86323430676
"role" => 1
"iat" => 1713966382
"exp" => 1713973582
"tokenExp" => 1713973582
]
$jwt_token = JWT::encode($token_payload, $sdk_secret, 'HS256');
Please tell me how I can go about implementing this and what the issue may be.
Thank you