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?