Invalid Signature using SDK as well custom signature creation

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

1 Like

Can you try to change signature role=0 . this issue because, MN and sdk key not the same account.
@longoff

@honeybeeyyh I have now used only Server To Server App credentials, but still getting that error.

I needed to try to create/start a meeting first. I have read that for that role needs to be 1. But tried to use role=0, which you needed me to try, but the error is same:

Joining Meeting Timeout or Browser restriction

Signature is invalid.

And in console.

Object { method: "join", status: false, result: "Invalid signature.", errorCode: 3712, errorMessage: "Signature is invalid." }

I have tried almost everything and finally when I could not progress, I posted here everything that I tried. I could not find any step by step guide, where I can use front end Web CDN SDK and REST API combination to create and join meetings.

Even the node JS web SDK is resulting in same error. There I only needed to provide client id and client secret inside index.js

I have attached a few screenshots using the web SDK. When I select Host then I get invalid signature error. When I select attendee, I am asked for passcode which I don’t have.

I am testing on my local server and there is no SSL. For CDN Web SDK version, I first used normal app credentials (not Server to Server) and there was signature error. But when I used Server to Server App credentials the error was “Meeting not found” (Host was selected not attendee).

I also need to know whether a single Server to Server credentials/app alone can be used for both REST API (backend) and Web CDN SDK (frontend) to implement what my requirements is?




.

Server to Server credentials can’t use to websdk
can you create and meeting sdk sdkkey/sdksecret to generate signature.
https://marketplace.zoom.us/develop/createLegacy

Thank you for your reply.

I had started by creating a normal app (Develop → Build App) and added client_id and client_secret Web SDK js/index.js. But it was resulting in an invalid signature error. So I thought, as Web SDK was not creating the meeting, I needed to create it through REST API. For that, I needed to create Server to Server App as ZAK needed an account ID.

Using Server to Server App, Meetings are successfully created on zoom.us and I can see urls, passwords, etc. I have tested, and those meetings work, but those are external urls (zoom.us)

Before trying anything again, I need some advice. So, please let me explain what my actual requirement is:

  1. I need to add zoom interface to my own website. The user should not leave the website to either create or join the meeting.

  2. There will be multiple users created on our backend, and they will be added to Zoom as well. I will automatically access their details to create meetings for them through REST API.

  3. Those users will click ‘Create meeting’ on my website, and it will automatically create a meeting (without any user intervention) and launch the web interface for that user, but user will remain on my website, and that is why I need web SDK to work on the front end.

  4. Other users will get notifications internally and either get a passcode or some meeting ID, etc., which they can click to join the meeting.

  5. I do not want any user to even know that it is all happening through zoom or go through OAuth manually to allow me to create a meeting or join it.

I am not sure but I think Web SDK APP OAuth requires user to manually authorize access to their account and that is not what I need.

So now, please tell me the correct and the best way to go about it is.

@longoff currently, if role=1 and zak not the same account, we don’t support start meeting >=2.15.0. we plan to fix this issue ASAP.
before we fix it, if you want to 3.6.0. there is an work around

create an Scheduled Meeting and join with role=0 and zak. your also can start it.

date_default_timezone_set('UTC');
$current_time = time(); // Get current time in Unix timestamp format
$plus_10_minutes = strtotime('+10 minutes', $current_time); // Add 10 minutes to current time
// $plus_10_minutes_str = date('Y-m-d H:i:s', $plus_10_minutes);
$plus_10_minutes_str = date('Y-m-dTH:i:sZ', $plus_10_minutes);

$fields_string = '{"topic":"Scheduled Meeting","type":2,"settings":{"jbh_time":15,"waiting_room":false,"join_before_host":true,"participant_video":false,"start_time":"'. $plus_10_minutes_str .'"}}';

1 Like

Hello,

Thank you for replying.

I seem to have made it working using my developer account.

I posted the steps I followed here: