Just wondering how can i hide the API key and Secret. By following the instructions on this page, created a heroku app and it seems to be working when i make a POST request from postman.
What don’t know is how to get the signature to my front end app make it work with out keeping api secret and key in my index.js file.
I’m using CDN version. Live version hosted on here
my index.js file,
(function(){
console.log('checkSystemRequirements');
console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
// it's option if you want to change the WebSDK dependency link resources. setZoomJSLib must be run at first
// if (!china) ZoomMtg.setZoomJSLib('https://source.zoom.us/1.7.2/lib', '/av'); // CDN version default
// else ZoomMtg.setZoomJSLib('https://jssdk.zoomus.cn/1.7.2/lib', '/av'); // china cdn option
// ZoomMtg.setZoomJSLib('http://localhost:9999/node_modules/@zoomus/websdk/dist/lib', '/av'); // Local version default, Angular Project change to use cdn version
ZoomMtg.preLoadWasm();
ZoomMtg.prepareJssdk();
var API_KEY = 'api_key';
var API_SECRET = 'secret';
document.getElementById('join_meeting').addEventListener('click', function(e){
e.preventDefault();
if(!this.form.checkValidity()){
alert("Enter Name and Meeting Number");
return false;
}
var meetConfig = {
apiKey: API_KEY,
apiSecret: API_SECRET,
meetingNumber: parseInt(document.getElementById('meeting_number').value),
userName: document.getElementById('display_name').value,
passWord: "",
leaveUrl: "https://zoom.us",
role: 0
};
var signature = ZoomMtg.generateSignature({
meetingNumber: meetConfig.meetingNumber,
apiKey: meetConfig.apiKey,
apiSecret: meetConfig.apiSecret,
role: meetConfig.role,
success: function(res){
console.log(res.result);
}
});
ZoomMtg.init({
leaveUrl: 'http://www.zoom.us',
isSupportAV: true,
success: function () {
ZoomMtg.join(
{
signature: signature,
meetingNumber: meetConfig.meetingNumber,
userName: meetConfig.userName,
signature: signature,
apiKey: meetConfig.apiKey,
userEmail: 'email@gmail.com',
passWord: meetConfig.passWord,
success: function(res){
$('#nav-tool').hide();
console.log('join meeting success');
},
error: function(res) {
console.log(res);
}
}
);
},
error: function(res) {
console.log(res);
}
});
});
})();
In the console i can see im getting a signature from my endpoint . But i notice that the length of signature received when i use heroku endpoint and using api key and secret directly on index.js page is different. (I have use the same meeting id to check both methods)
Is the issue here my endpoint not working properly and its wending the incorrect signature or is there any coding issue in my index.js file.
The JSON format returned from my visit to your URL address is shown below, but I don’t see the parsing of this JSON object in your code, and the corresponding fields are used for correct assignment. Please check.
{
“signature”: “”
}
I’m having the same problem as @charitha.
I can join a meeting successfully when using ZoomMtg.generateSignature() but I am getting an error when trying to use the Heroku app (/docs/sdk/native-sdks/web/essential/signature)
I’ve deployed it and entered my API key and secret – the same ones I’m using for the built-in generateSignature() function.
The error I’m getting doesn’t specify anything, unfortunately. It just says:
errorCode:1
errorMessage:“joining fail”
method:“join”
result:null
status:false
To check, I am comparing the signatures generated by the card-coded one and the heroku app and they start similarly but are different and also a different length.
At this point my two best guesses are
that there is some difference in the way that ‘crypto’ and ‘crypto-js’ do their hashing or
that there’s some problem being caused by web string encoding or something like that.
We just updated our sample generate signature app for node.js[1]. Can you re-clone the repo and see if generating a signature and joining a meeting works for you now?
Thanks @michael_p.zoom,
I will look into this more tomorrow. I see that you changed the Date().getTime() to include -30000 so it matches the other documentation.
From my immediate test, though, it seems to have the same problem where the keys returned are different lengths.
The built-in generateKey returns a 126 character string:
eg.
@michael_p.zoom
I’m still having the same problem.
Does anyone have an idea why the heroku app would return a different length of string from the built-in ZoomMtg.generateSignature function?
My first mistake was sending this POST request to the endpoint in text format It should be JSON request.
Secondly, as @zhang_meifu mentioned in his reply, i had few issue with my index.js too. The issue was, reply from my javascript fetch request did not correctly passed to the ZoomMtg.join function. About hour of trial and error, i was able to fix my code finally.
Happy to say its working well now. Below is my index.js file.
It was working perfectly until now and im getting following error in console.
Sample web app show the following error:- Your connection has timed out and you cannot join the meeting. Verify your network connectivity and try again.
The best workaround is to use the Zoom Desktop / Mobile app.
Just include the Zoom meeting join url (https://zoom.us/j/meetingID) on your site rather than showing the websdk / iframe. Clicking on the join url will open the Zoom meeting in the Zoom app.