Zoom JWT Meeting timeout fail to join meeting

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>
`

@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.

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
}

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

important: if you create a new Meeting SDK app

id

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

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