# Zoom JWT Meeting timeout fail to join meeting

**URL:** <https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943>\
**Category:** Web\
**Created:** [May 7, 2023, 10:13am UTC](https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943 "2023-05-07T10:13:34Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mosamater32](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/mosamater32/32/48251_2.png) [@mosamater32](https://devforum.zoom.us/u/mosamater32)\
**Post date:** [May 7, 2023, 10:13am UTC](https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943/1 "2023-05-07T10:13:34Z")

</div>

I have seen a similar issues and the solution was to create a JWT app for me it does not show a create button and says it will be deprecated is there any solutions? it was working till yesterday no code changes were made  
and this is my code

`

 Zoom Class 

 document.onkeydown = function(e) { if (event.keyCode == 123) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'I'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'C'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.shiftKey && e.keyCode == 'J'.charCodeAt(0)) { return false; } if (e.ctrlKey && e.keyCode == 'U'.charCodeAt(0)) { return false; } } \<?php function generate\_signature($api\_key, $api\_secret, $meeting\_number, $role) { $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), '+/', '-\_'), '='); } ?\> window.toolsZoom = { detectOS: function() { var sUserAgent = navigator.userAgent; var isWin = (navigator.platform === 'Win32') || (navigator.platform === 'Windows'); var isMac = (navigator.platform === 'Mac68K') || (navigator.platform === 'MacPPC') || (navigator.platform === 'Macintosh') || (navigator.platform === 'MacIntel'); if (isMac) return 'Mac'; var isUnix = (navigator.platform === 'X11') && !isWin && !isMac; if (isUnix) return 'Unix'; var isLinux = (String(navigator.platform).indexOf('Linux') \> -1); if (isLinux) return 'Linux'; if (isWin) { var isWin2K = sUserAgent.indexOf('Windows NT 5.0') \> -1 || sUserAgent.indexOf('Windows 2000') \> -1; if (isWin2K) return 'Win2000'; var isWinXP = sUserAgent.indexOf('Windows NT 5.1') \> -1 || sUserAgent.indexOf('Windows XP') \> -1; if (isWinXP) return 'WinXP'; var isWin2003 = sUserAgent.indexOf('Windows NT 5.2') \> -1 || sUserAgent.indexOf('Windows 2003') \> -1; if (isWin2003) return 'Win2003'; var isWinVista = sUserAgent.indexOf('Windows NT 6.0') \> -1 || sUserAgent.indexOf('Windows Vista') \> -1; if (isWinVista) return 'WinVista'; var isWin7 = sUserAgent.indexOf('Windows NT 6.1') \> -1 || sUserAgent.indexOf('Windows 7') \> -1; if (isWin7) return 'Win7'; var isWin10 = sUserAgent.indexOf('Windows NT 10') \> -1 || sUserAgent.indexOf('Windows 10') \> -1; if (isWin10) return 'Win10'; } return 'other'; }, detectIE: function() { var ua = window.navigator.userAgent;

```
            // Test values; Uncomment to check result …

            // IE 10
            // ua = 'Mozilla/5.0 (compatible; MSIE 10.0; Windows NT 6.2; Trident/6.0)';

            // IE 11
            // ua = 'Mozilla/5.0 (Windows NT 6.3; Trident/7.0; rv:11.0) like Gecko';

            // Edge 12 (Spartan)
            // ua = 'Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/39.0.2171.71 Safari/537.36 Edge/12.0';

            // Edge 13
            // ua = 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2486.0 Safari/537.36 Edge/13.10586';

            var msie = ua.indexOf('MSIE ');
            if (msie > 0) {
                // IE 10 or older => return version number
                return 'IE' + parseInt(ua.substring(msie + 5, ua.indexOf('.', msie)), 10);
            }

            var trident = ua.indexOf('Trident/');
            if (trident > 0) {
                // IE 11 => return version number
                var rv = ua.indexOf('rv:');
                return 'IE' + parseInt(ua.substring(rv + 3, ua.indexOf('.', rv)), 10);
            }

            var edge = ua.indexOf('Edge/');
            if (edge > 0) {
                // Edge (IE 12+) => return version number
                return 'Edge' + parseInt(ua.substring(edge + 5, ua.indexOf('.', edge)), 10);
            }

            // other browser
            return false;
        },
        getBrowserInfo: function() {
            var agent = navigator.userAgent.toLowerCase();
            var regStr_ff = /firefox\/[\d.]+/gi;
            var regStr_chrome = /chrome\/[\d.]+/gi;
            var regStrChrome2 = /ipad; cpu os (\d+_\d+)/gi;
            var regStr_saf = /safari\/[\d.]+/gi;
            var regStr_edg = /edg\/[\d.]+/gi;

            // firefox
            if (agent.indexOf('firefox') > 0) {
                return agent.match(regStr_ff);
            }

            // Safari
            if (agent.indexOf('safari') > 0 && agent.indexOf('chrome') < 0) {
                var tmpInfo;
                if (agent.indexOf('ipad') > 0) {
                    tmpInfo = agent.match(regStrChrome2).toString().replace('ipad; cpu os ', 'ipados/');
                } else {
                    tmpInfo = agent.match(regStr_saf);
                    tmpInfo = tmpInfo.toString().replace('version', 'safari');
                }
                return tmpInfo;
            }

            // IE / Eege
            var tmpIsIE = toolsZoom.detectIE();
            if (tmpIsIE) {
                return tmpIsIE;
            }
            // Chrome
            if (agent.indexOf('chrome') > 0) {
                return agent.match(regStr_chrome);
            }

            return 'other';
        },
        getRandomInt: function(max) {
            return Math.floor(Math.random() * Math.floor(max));
        },
        extractHostname: function(url) {
            var hostname;
            if (url.indexOf('//') > -1) {
                hostname = url.split('/')[2];
            } else {
                hostname = url.split('/')[0];
            }
            hostname = hostname.split(':')[0];
            hostname = hostname.split('?')[0];
            return hostname;
        },
        getDomainName: function(hostName) {
            return hostName.substring(
                hostName.lastIndexOf('.', hostName.lastIndexOf('.') - 1) + 1
            );
        },
        setCookie: function(cname, cvalue) {
            var exdays = 1;
            var d = new Date();
            d.setTime(d.getTime() + (exdays * 24 * 60 * 60 * 1000));
            var expires = 'expires=' + d.toUTCString();
            document.cookie = cname +
                '=' +
                cvalue +
                ';' +
                expires +
                ';path=/';
        },
        getCookie: function(cname) {
            var name = cname + '=';
            var decodedCookie = decodeURIComponent(document.cookie);
            var ca = decodedCookie.split(';');
            for (var i = 0; i < ca.length; i += 1) {
                var c = ca[i];
                while (c.charAt(0) === ' ') {
                    c = c.substring(1);
                }
                if (c.indexOf(name) === 0) {
                    return c.substring(name.length, c.length);
                }
            }
            return '';
        },
        deleteAllCookies: function() {
            var cookies = document.cookie.split(";");
            for (var i = 0; i < cookies.length; i++) {
                var cookie = cookies[i];
                var eqPos = cookie.indexOf("=");
                var name = eqPos > -1 ? cookie.substr(0, eqPos) : cookie;
                document.cookie = name + "=;expires=Thu, 01 Jan 1970 00:00:00 GMT";
            }
        }
    }

    console.log('checkSystemRequirements');
    console.log(JSON.stringify(ZoomMtg.checkSystemRequirements()));
    ZoomMtg.setZoomJSLib('https://dmogdx0jrul3u.cloudfront.net/2.12.0/lib', '/av');

    ZoomMtg.preLoadWasm();
    ZoomMtg.prepareJssdk();

    var zoomLang = "en-US";
    window.toolsZoom.setCookie("meeting_lang", zoomLang);
    // $.i18n.reload(zoomLang);

    ZoomMtg.reRender({
        lang: zoomLang
    });

    ZoomMtg.init({
        leaveUrl: '<?php echo ($leaveUrl); ?>',
        isSupportAV: true,
        showMeetingHeader: true,
        isSupportChat: true,
        isSupportCC: true,
        rwcBackup: true,
        videoHeader: true,
        meetingInfo: [ // optional
            'topic',
            'host',
            'participant',
            'dc',
            'enctype',
            'report'
        ],

        success: function() {
            // $usertype == 'Student'?0:
            ZoomMtg.join({
                meetingNumber: '<?= $meetingID ?>',
                userName: '<?= $name ?>',
                signature: '<?= generate_signature(ZOOM_API_KEY, ZOOM_API_SECRET, $meetingID, $role) ?>',
                apiKey: '<?= ZOOM_API_KEY ?>',
                passWord: '<?= $room_password ?>',
                success: function(res) {
                    $('.header, .main-footer').remove();
                },
                error: function(res) {
                    console.log(res);
                }
            });
        },
        error: function(res) {
            console.log(res);
        }
    });
</script>

```

`

---

<div class="post-metadata">

**Author:** ![freelancer.nak](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/freelancer.nak/32/40968_2.png) [@freelancer.nak](https://devforum.zoom.us/u/freelancer.nak)\
**Post date:** [May 7, 2023, 2:20pm UTC](https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943/2 "2023-05-07T14:20:05Z")

</div>

@mosamater32 hope you will be fine.

First thing please format the code section in your above post.

You need to create MeetingSDK App & then get SDK Key & Secret to generate the signature.

If you are using NodeJS then here is a sample of how to generate the signature.

```auto
const KJUR = require('jsrsasign');

function generateSignature(meetingNumber, role) {
    const iat = Math.round(new Date().getTime() / 1000) - 30;
    const exp = iat + 60 * 60 * 2

    const oHeader = {
        alg: 'HS256',
        typ: 'JWT'
    }

    const oPayload = {
        sdkKey: process.env.ZOOM_APP_KEY,
        mn: meetingNumber,
        role: role,
        iat: iat,
        exp: exp,
        appKey: process.env.ZOOM_APP_KEY,
        tokenExp: iat + 60 * 60 * 2
    }

    const sHeader = JSON.stringify(oHeader)
    const sPayload = JSON.stringify(oPayload)
    const signature = KJUR.jws.JWS.sign('HS256', sHeader, sPayload, process.env.ZOOM_APP_SECRET)

    return signature;
}

module.exports = {
    generateSignature
}

```

---

<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:** [May 7, 2023, 3:19pm UTC](https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943/3 "2023-05-07T15:19:10Z")

</div>

here is a guide how to migrate from JWT app to Meeting SDK app

> **[JWT app type migration guide](https://developers.zoom.us/docs/internal-apps/jwt-app-migration/#jwt-app-type-to-sdk-app-type-migration)**
>
> The Zoom Developer Platform is an open platform that allows third-party developers to build applications and integrations upon Zoom’s video-first unified communications platform.

important: if you create a new Meeting SDK app

![id](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/f/2/f22699916674842c6e256a3f17d0f51dfd29b21e.png)

and here an example, how to create the signature on your php server

> [@Client SDK Invalid Signature errorCode:200 PHP](https://devforum.zoom.us/t/client-sdk-invalid-signature-errorcode-200-php/85056/4):
>
> Thanks everyone for your support. @chunsiong.zoom Not the case but good thinking. That was a JWT app already working, the request was complete. @j.schoenemeyer I tried that code too, the code I implemented as an example is just one of the many, actually the older, so yes, as you say, not good as it was for JWT Token and not SDK. I also found at least two other similar examples to work with PHP and generate an SDK JWT Token but all of them were using third party software for encryption which I…

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [June 7, 2023, 1:19am UTC](https://devforum.zoom.us/t/zoom-jwt-meeting-timeout-fail-to-join-meeting/87943/4 "2023-06-07T01:19:24Z")

</div>

Closed on June 7, 2023, 1:19am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
