I made a Server-to-Server OAuth application to use a Webhook and API. How to create JWT for the API?

I made a Server-to-Server OAuth application to use a Webhook and API. How to create JWT for the API?

I saw the notification that This app type will be deprecated on 6/1/2023 on JWT app type. Thus, I want to use Zoom API with Webhook, and I choose the Server-to-Server OAuth app type.

However, I can use the Client ID and Client secret , but cannot use the JWT for the API. Are there anyways to use the Client ID and Client secret to create JWT, or should I use another type of apps?

Actually, JWT app type will be deprecated.

To generate a token using s2s app, make a post request to the Zoom OAuth Endpoint.

Here is how to make the request to the OAuth endpoint:

curl --location --request POST ‘https://zoom.us/oauth/token?grant_type=account_credentials&account_id=
–header ‘Authorization: Basic (Base64 encode clientID:clientsecret)’ \

1 Like

And how to modify the code for join in zoom using s2s OAuth app type , I got client id and client secret as app credentials and how to execute this
below code is used for jwt , from this how to modify for server-to-server oauth

<?php echo get_phrase('live_class'); ?> : <?php echo $course_details['title']; ?>
<script src="https://source.zoom.us/2.6.0/lib/vendor/react.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/react-dom.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/redux.min.js"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/redux-thunk.min.js"></script>
<script src="<?php echo base_url('assets/backend/js/jquery-3.3.1.min.js'); ?>"></script>
<script src="https://source.zoom.us/2.6.0/lib/vendor/lodash.min.js"></script>
<script src="https://source.zoom.us/zoom-meeting-2.6.0.min.js"></script>

<script>

$(window).on("orientationchange",function(){
    console.log("Orientation changed");
});
function stop_zoom() {
    var r = confirm("<?php echo get_phrase('do_you_want_to_leave_the_live_video_class'); ?> ? <?php echo get_phrase('you_can_join_them_later_if_the_video_class_remains_ive'); ?>");
    if (r == true) {
        ZoomMtg.leaveMeeting();
    }

}

$(document).ready(function() {
    start_zoom();
});

function start_zoom() {

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

    var API_KEY = "<?php echo get_settings('zoom_api_key'); ?>";
    var API_SECRET = "<?php echo get_settings('zoom_secret_key'); ?>";
    var USER_NAME = "<?php echo $logged_user_details['first_name'] . " " . $logged_user_details['last_name']; ?>";
    var MEETING_NUMBER = "<?php echo $live_class_details['zoom_meeting_id']; ?>";
    var PASSWORD = "<?php echo $live_class_details['zoom_meeting_password']; ?>";

    testTool = window.testTool;


    var meetConfig = {
        apiKey: API_KEY,
        apiSecret: API_SECRET,
        meetingNumber: MEETING_NUMBER,
        userName: USER_NAME,
        passWord: PASSWORD,
        leaveUrl: "<?php echo site_url('home/live_class_mobile_web_view/' . slugify($course_details['id']) . '/' . $logged_user_details['id']); ?>/true",
        role: 0
    };


    var signature = ZoomMtg.generateSignature({
        meetingNumber: meetConfig.meetingNumber,
        apiKey: meetConfig.apiKey,
        apiSecret: meetConfig.apiSecret,
        role: meetConfig.role,
        success: function(res) {
            console.log(res.result);
        }
    });

    ZoomMtg.init({
        leaveUrl: "<?php echo site_url('home/live_class_mobile_web_view/' . slugify($course_details['id']) . '/' . $logged_user_details['id']); ?>/true",
        meetingInfo: [ 'topic', 'host'],
        isSupportAV: true,
        success: function() {
            ZoomMtg.join({
                meetingNumber: meetConfig.meetingNumber,
                userName: meetConfig.userName,
                signature: signature,
                apiKey: meetConfig.apiKey,
                passWord: meetConfig.passWord,
                success: function(res) {
                    console.log('join meeting success');
                },
                error: function(res) {
                    console.log(res);
                }
            });
        },
        error: function(res) {
            console.log(res);
        }
    });
}
</script>

Please follow the guidelines here: JWT app type migration guide