Zoom Web SDK “Signature is invalid” 3712 error code

Description
We create a sample script, how it is described on https://marketplace.zoom.us/docs/sdk/native-sdks/web/signature but cannot join, we always became an error with signature. We also try to use the described service, to generate a signature, but also the same issue.

Error

  1. {method: “join”, status: false, result: “Invalid signature.”, errorMessage: undefined, errorCode: 3712}
  2. errorCode: 3712
  3. errorMessage: undefined
  4. method: “join”
  5. result: “Invalid signature.”

Which App Type (OAuth / Chatbot / JWT / Webhook)?
JWT

Which Endpoint/s?
Web SDK 2.1.1

How To Reproduce (If applicable)

<?php

$api_key = '8CTcTLrpQr-J_9P6xtiJDg';
$api_secret = 'XYZ';
$meeting_number = 86764390572;

$signature = generate_signature($api_key, $api_secret, $meeting_number, 0);

function generate_signature ( $api_key, $api_secret, $meeting_number, $role){
  //Set the timezone to UTC
  date_default_timezone_set("UTC");
  $time = time() * 1000 - 30000;//time in milliseconds (or close enough)
  $data = base64_encode($api_key . $meeting_number . $time . $role);
  $hash = hash_hmac('sha256', $data, $api_secret, true);
  $_sig = $api_key . "." . $meeting_number . "." . $time . "." . $role . "." . base64_encode($hash);
  return rtrim(strtr(base64_encode($_sig), '+/', '-_'), '=');
}
?>
<html>
<head>
    <!-- For Web Client View: import Web Meeting SDK CSS -->
    <link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.1.1/css/bootstrap.css" />
    <link type="text/css" rel="stylesheet" href="https://source.zoom.us/2.1.1/css/react-select.css" />
</head>

<body>


<script>
  // make an http request to your server to get the signature
  document.onreadystatechange = function () {
    if (document.readyState == "complete") {
      ZoomMtg.preLoadWasm();
      ZoomMtg.prepareWebSDK();
      // loads language files, also passes any error messages to the ui
      ZoomMtg.i18n.load('de-DE');
      ZoomMtg.i18n.reload('de-DE');

      // For Global, use source.zoom.us:
      ZoomMtg.setZoomJSLib('https://source.zoom.us/2.1.1/lib', '/av');

      var leaveUrl = 'https://www.test.com'

      ZoomMtg.init({
        leaveUrl: leaveUrl,
        success: (success) => {
          console.log(success)
          ZoomMtg.join({
            signature: '<?=$signature;?>',
            meetingNumber: <?=$meeting_number;?>,
            userName: 'username',
            apiKey: '<?=$api_secret;?>',
            userEmail: 'mail@mail.com',
            //passWord: '',
            success: (success) => {
              console.log('ok');
              console.log(success)
            },
            error: (error) => {
              console.log('error');
              console.log(error)
            }
          });
        },
        error: (error) => {
          console.log(error)
        }
      });

    }
  }


</script>


<!-- For either view: import Web Meeting SDK JS dependencies -->
<script src="https://source.zoom.us/2.1.1/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/2.1.1/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/2.1.1/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/2.1.1/lib/vendor/redux-thunk.min.js"></script>
<script src="https://source.zoom.us/2.1.1/lib/vendor/lodash.min.js"></script>

<!-- For Component View -->
<script src="https://source.zoom.us/2.1.1/zoom-meeting-embedded-2.1.1.min.js"></script>

<!-- For Client View -->
<script src="https://source.zoom.us/zoom-meeting-2.1.1.min.js"></script>
</body>

</html>

Screenshots (If applicable)
No

Additional context
Here you have an example signature, generated right now 18.01.2022 08:07 (Zurich)

@tommy I read your the expert in signature issues :slight_smile: possible you can help us?

Greeting, @stahl,

Welcome to the Developer Forum and thank you for posting. Can verify that you are using your API Key and Secret from your JWT App for your credentials. Also, you want to make sure that your server is using a UTC timezone when generating the signature. You reference our documentation for instructions on how to generate the Web SDK signature as well:

You can also reference the Signature Generator Sample app to compare a working signature with yours:

Let me know if this helps.

Best,
Donte

hi @donte.S thank you for your feedback. My Issue was, that we need to generate the signature quick before join process. so you can close this issue

1 Like

@stahl Thanks for following up and sharing your solution