Web SDK Can't Join as Host

This code works when role = 0 but not when role = 1

This is the error we are getting when role = 1, how can we host a meeting with the web SDK?

Hey @That-Tech-Guy,

Please provide more details like your code, how you are generating your signature, and steps to reproduce the issue.

Reminder: the Web SDK does not support starting webinars, only meetings.

Thanks,
Tommy

Okay, we are certainly having trouble starting a meeting with the websdk. When the documentation says we can start a meeting though, does that mean we start the meeting as a host and have control over other users in the meeting, or does it just mean start as a participant?

Joining meetings as a participant is working, when we set role to 0. But, when we set role to 1, we get the following error:

image

We are generating the signature in node.js with the following code:

exports.generateSignature = function(meetingNumber, role){
console.log("generating signature with: ", meetingNumber, role);
const timestamp = new Date().getTime();
const msg = Buffer.from(apiKey + meetingNumber + timestamp + role).toString(‘base64’);
const hash = crypto.createHmac(‘sha256’, apiSecret).update(msg).digest(‘base64’);
const signature = Buffer.from(${apiKey}.${meetingNumber}.${timestamp}.${role}.${hash}).toString(‘base64’);

return signature;
}

We’ve also tried generating the signature client side with the webSDK itself:

ZoomMtg.generateSignature({
meetingNumber: meetConfig.meetingNumber,
apiKey: meetConfig.apiKey,
apiSecret: meetConfig.apiSecret,
role: meetConfig.role,
success: res => {

This results in the same error when role is set to 1.
We’re setting up the websdk in a react.js project like this:

import { ZoomMtg } from “@zoomus/websdk”;
ZoomMtg.setZoomJSLib(“node_modules/@zoomus/websdk/dist/lib”, “/av”);
ZoomMtg.setZoomJSLib(“https://source.zoom.us/1.7.2/lib”, “/av”);
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();

Thanks!

Hi @That-Tech-Guy,

What is the meeting ID that you use when you try to join as a host? Keep in mind if you join as host then the meeting ID needs to be from the host that you use the API Key Secret for.

Thanks
Michael

So, if I’m understanding what you’re saying, if I created a meeting with an Oauth token, I can then use a key from a JWT app to join as a participant but not as the host?

I’m a little confused, because I created an Oauth app, got a user token, used that to create a meeting, then tried to join as a participant and it wasn’t working. So I then created a JWT app, and used that key and secret and was able to join as a participant.

So, is it possible for me to join as a host a meeting I created with a token from an OAuth token app using the WebSDK?

If so, what information should i be using to

  • create the meeting via api,
  • create the signature to join the meeting
  • join the meeting

Thanks!

Hi @That-Tech-Guy

Yes, you can join a meeting that was created using an OAuth token as a WebSDK participant. To join as a WebSDK host, that meeting needs to be under the same account as the JWT API Key Secret since a JWT app is an account wide app.

Yes, as long as the meeting is under the same account as the created JWT app.

Does this helps? If not, please post the meeting ID that you’re getting the error from and the Account ID.

Thanks

1 Like

Yes this helps very much!

We may have a few more questions as we begin to test, but we’ve successfully joined as a host now.

Thanks!

1 Like

Happy to hear it worked!

Yes, please let us know if you have additional questions!

Thanks,
Tommy

Does this imply that there is no way to make a product with the WebSDK where people create & host meetings under their own Zoom accounts?

It seems like OAuth and the SDK don’t really interact at all. Is the SDK really only meant for ISV partners?

Hi @riley,

No, that’s not what I was implying towards.
The credentials for the WebSDK are located within the JWT App, their’s only one JWT app per account. No matter how many users within that account who log into marketplace and create other app types, they will still see the same JWT app with the same credentials.

For example you have Account A with user 1, user 2, and user 3 who are all under the same account.

  1. User 1 creates a JWT app for the account.
  2. User 2 creates an Account-level OAuth app, then uses the app to create meetings for himself and User 3.
  3. When User 2 configures the WebSDK, he enters the JWT app API Key/Secret credentials and changes the “role” parameter to 1 to start a meeting as a host.
  4. User 2 enters in the meeting ID that was created for them by the OAuth app and they’re now the host using the WebSDK.
  5. Later that day, User 3 enters in the meeting ID that was created for them by the OAuth app and they can become the host as well using the WebSDK.

So as long as the users are under the same account, they can start a meeting as a host using the WebSDK.

The WebSDK can be used for both licenses and ISV partners as ISV partners are billed based on minutes.

Hope this helps, let us know if you have any other questions.

Thanks
#codeHappy

Thanks a lot for the further explanation!

What about a hypothetical User 4 who is in a DIFFERENT account, Account B.

Is there any way to make a product with the SDK under Account A, and then allow users from Account B to host meetings with that product?

Hey @riley,

The user from the different account B won’t be able to host meetings, only join them via the Web SDK created by account A.

Thanks,
Tommy

Ok, thanks. It sounds like it would be impossible to make a website where users from different Zoom accounts use the website to create meetings and then host them from the SDK.

If my understanding is correct, it might make more sense to use the web client than the SDK, since users from different Zoom accounts can host meetings in the web client. Does that sound right? Is using the web client url inside an iframe a supported use case we can depend on?

In other words, is it safe to embed an iframe with url https://zoom.us/wc/${meeting.id}/join?prefer=1& or should I expect that url to change or become un-embeddable?

Hey @riley,

Correct, however the intention of the Web SDK is to join meetings. Any meeting can be joined by a user using the Web SDK, but only meetings owned by the Web SDK can be started.

For your use case of wanting 3rd party users to host meetings on your site then yes, use an iFrame or have them just click the start URL to host using the Zoom Client.

Yes, we have no plans to stop supporting the Zoom Web Client

Thanks,
Tommy