- I generate the 32 bit code verifier client side
function generateRandomString(length) {
var text = "";
var possible = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for (var i = 0; i < length; i++) {
text += possible.charAt(Math.floor(Math.random() * possible.length));
}
return text;
}
- I listen for the onAuthorized event.
zoomSdk.addEventListener("onAuthorized", function(event){
event.verifier = codeVerifier
jsonRequest(api_url + "/client_authorize" , event, 'POST', async function (json) {
if (json != null) {
console.log(json)
}
})
console.log(event)
})
- I sent a random state and codeChallenge to the zoom api (using the codeVerifier as codeChallenge as it is PKCE plain)
const result = await zoomSdk.callZoomApi("authorize", {
"state": state,
"codeChallenge": codeVerifier
})
- at the server side I send a tokenRequest using the unchanged code form the zoomapps-sample-js on github, (it works when I use the tranditional OAuth flow)
- Getting 400 bad request, does anyone know why this is a bad request?
Thank you,
Auke van Scheltinga