# Ruby - signature is invalid. Error code: 3712

**URL:** <https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435>\
**Category:** Meeting SDK\
**Created:** [September 20, 2023, 11:05am UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435 "2023-09-20T11:05:09Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![mateusz.p](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mateusz.p/32/52214_2.png) [@mateusz.p](https://devforum.zoom.us/u/mateusz.p)\
**Post date:** [September 20, 2023, 11:05am UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435/1 "2023-09-20T11:05:09Z")

</div>

Hey,  
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 [https://github.com/zoom/meetingsdk-javascript-sample/blob/master/component-view.js](https://github.com/zoom/meetingsdk-javascript-sample/blob/master/component-view.js)  
But I got error from SDK “signature is invalid. Error code: 3712”.  
My code:  
ruby - create signature

```auto
   iat = Time.now.to_i - 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:  
`eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzZGtLZXkiOiJDODZjSllIclJmbXozNVo5UkhxR2tnIiwiYXBwS2V5IjoiQzg2Y0pZSHJSZm16MzVaOVJIcUdrZyIsIm1uIjo4NDE3MDMxMDc5Mywicm9sZSI6MCwiaWF0IjoxNjk1MjA0MzE5LCJleHAiOjE2OTUyMTE1MTksInRva2VuRXhwIjoxNjk1MjExNTE5fQ.B2DUipxAe_LNzm8CyfQstom5Qc7fP7QypsuCq38BjZQ`

JS SDK:

```auto
      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 = ''

      client.init({
        zoomAppRoot: meetingSDKElement,
        language: 'en-US',
      })

      client.join({
        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.

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [September 20, 2023, 5:33pm UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435/2 "2023-09-20T17:33:02Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![mateusz.p](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mateusz.p/32/52214_2.png) [@mateusz.p](https://devforum.zoom.us/u/mateusz.p)\
**Post date:** [September 21, 2023, 5:58am UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435/3 "2023-09-21T05:58:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![j.schoenemeyer](https://avatars.discourse-cdn.com/v4/letter/j/f9ae1b/32.png) [@j.schoenemeyer](https://devforum.zoom.us/u/j.schoenemeyer)\
**Post date:** [September 21, 2023, 5:07pm UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435/4 "2023-09-21T17:07:24Z")

</div>

here are more infos for troubleshooting signature

> **[Troubleshooting Zoom Meeting SDK signature validation](https://dev.to/zoom/troubleshooting-zoom-meeting-sdk-signature-validation-1hln)**
>
> In this guide, we’ll cover common issues you may run into when generating a signature for the Zoom...

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

embeded view (-\> public/cdn.html)

> <https://github.com/zoom/meetingsdk-web-sample/tree/master/Components>
>
> //github.com/zoom/meetingsdk-web-sample/tree/master/Components

client view (-\> CND/index.html)

> **[GitHub - zoom/meetingsdk-web-sample: Zoom Meeting SDK web sample](https://github.com/zoom/meetingsdk-web-sample)**
>
> Zoom Meeting SDK web sample. Contribute to zoom/meetingsdk-web-sample development by creating an account on GitHub.

---

<div class="post-metadata">

**Author:** ![mateusz.p](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mateusz.p/32/52214_2.png) [@mateusz.p](https://devforum.zoom.us/u/mateusz.p)\
**Post date:** [September 22, 2023, 7:10pm UTC](https://devforum.zoom.us/t/ruby-signature-is-invalid-error-code-3712/95435/5 "2023-09-22T19:10:46Z")

</div>

@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 😉 Thanks!
