Ruby - signature is invalid. Error code: 3712

I’m creating app which should create meeting via API, next users join to this meeting using only browser.
I’ve created app “Server-to-Server OAuth” in Zoom Market.
I have a working creating access token.
I have a working creating meeting using API with this access token.
And next I wanna start video using component-view like here
But I got error from SDK “signature is invalid. Error code: 3712”.
My code:
ruby - create signature

   iat = - 30
   exp = iat + 60 * 60 * 2
    header = {
      alg: 'HS256',    
      typ: 'JWT'        
    payload = {
      sdkKey: client_id,
      appKey: client_id,
      mn: meeting_id,
      role: 0,
      iat: iat,
      exp: exp,
      tokenExp: exp
    signature = JWT.encode(payload, client_secret, 'HS256', header)

Signature is like this:


      const client = ZoomMtgEmbedded.createClient()
      let meetingSDKElement = document.getElementById('video-call')
      var authEndpoint = ''
      var sdkKey = ''
      var meetingNumber = "MEETING_NUMBER";
      var passWord = '';
      var role = 1;
      var userName = 'JavaScript'
      var userEmail = ''
      var registrantToken = ''
      var zakToken = ''

        zoomAppRoot: meetingSDKElement,
        language: 'en-US',

        role: 1,
        signature: "SIGNATURE",
        sdkKey: 'CLIENT_ID',
        meetingNumber: meetingNumber,
        password: passWord,
        userName: userName,
        userEmail: userEmail,
        tk: registrantToken,
        zak: zakToken

MEETING_NUMBER, SIGNATURE, CLIENT_ID - these are variables from ruby. So values are correct.

Please help me. I’m stuck on with this.

“role” does not match - in the signature it says “role=0” (attendee), when joining it says “role=1” (host)

Thanks for the reply. I tried with role as 0 and 1. But I got the same error ;/

here are more infos for troubleshooting signature

if this not help, you should go a step back and try the the zoom SDK example (without backend)

embeded view (-> public/cdn.html)

client view (-> CND/index.html)

@j.schoenemeyer Hey! Thanks for the links.
I started checking all points from the troubleshooting zoom article.
And there is: “Make sure you’re using a Meeting SDK app type, not OAuth or server-to-server OAuth.”
I used only Server-to-Server OAuth".
So after changes I have:
Server-to-server credentials: create access token, create meeting via API.
Meeting SDK credentials: create signature and fire up component-view in JS.
Ah! I had to add a password for the meeting.
Now it seems to work :wink: Thanks!

1 Like