zoomSdk.onAuthorized is not triggred

Hi ,

I’m trying to make in-client OAuth to get the authorization code for posting and requesting access token.

First , I’m using the zoomSdk.config as follows :

const configResponse = await zoomSdk.config({
version: “0.16”,
popoutSize: { width: 480, height: 360 },
capabilities: [“shareApp”,
“authorize”,
“onAuthorized”

        ]
    })

And that’s working and receiving correct answer.(Also got the authorize checked and onAuthorized also checked in app features)

Afterwards using the authorize function and getting also “Success” message.

But somehow the onAuthorized isn’t triggered and I’m not getting the code needed to request access token.

Any thoughts ?

Thanks

Hi, we have detailed implementation of in-client oauth which uses authorize and onAuthorized in our reference app GitHub - zoom/zoomapps-advancedsample-react: This repository contains an Advanced Zoom Apps Sample. It should serve as a starting point for you to build and test your own Zoom App in development. . Could you take a look at the implementation process and see if you could resolve the issue?

I have the same issue as @eladw

After config, I run the authorize function and get back the message: “success” but the onAuthorized is not triggered.

I check out your code on GitHub. We are not using React, but your code I see in your ‘Authorization.js’ file is quite similar to what we’ve done.

However, the onAuthorized is not being triggered?

Here’s one of many attempts:

function configAndAuthZoom(jsCodeChallenge){
    zoomSdk.config({
     version: "0.16",
     popoutSize: {width: 480, height: 360},
     capabilities: ["openURL,shareApp,getMeetingContext,showNotification,getMeetingParticipants,getuserContext,launchAppInMeeting,drawImage,clearImage,authorize,promptAuthorize,onAuthorized"]
   }).then((x) =>{
        console.log("addEventListener begin add");
        const addEventResponse = zoomSdk.addEventListener("onAuthorized", function(event){
        console.log("onAuth Evt: " + event);
       $.post("/api/v1/auth/token",
            event,
            function(data,status){
                console.log("Data: " + data + "\nStatus: " + status);
                $.ajax({
                    type: "POST",
                    url: "/ourbackend/GetAccessToken.script,
                    data:{
			"code": data,
                        "pkce": jsCodeChallenge
                    },
                    dataType: "json",
                    success: function(data){
                        console.log("Token Received");
                    }
                });
            });
        });
        console.log("addEventListener end add");
   }).then((y) =>{
        zoomSdk.callZoomApi("authorize",{
            "state":"testing",
            "codeChallenge":jsCodeChallenge //variable comes from caller code
        }).then((ret) => {
            console.log("API Call: ");
            console.log(ret.message);
            if(ret.message == "Success"){

            }
        }).catch((e) => {
            console.log("API Error: ");
            console.log(e);
        });
   });
}

Here is the console log:

-addEventListener begin add
-addEventListener end add
-API Call:
-Success

Notice the onAuthorized event does not appear to trigger.

Ideas?

Double check it has been added to the marketplace and that you’ve reinstalled the app after adding the event.

If you’re still having issues after that, then you can define the promise to see if that affects the behavior.

Let me know if that helps.