Error calling authorize API immediately after loading the app when using in-client auth

Its my understanding that when using in-client auth, the user does not yet have an oauth token. My goal here is to call the authorize api to get the oauth token when loading the app immediately after in-client auth is completed and the app is installed.

I am getting the following error:
image

I can also see that the following request in the next screenshot is being made with the pasted payload below:

Payload:

[{"originUri":"/zoomapp/authorize","ts":1652792367310,"to":1,"userAgent":{"os":"Mozilla/5.0 ZoomWebKit/537.36 (KHTML, like Gecko) ZoomApps/1.0"},"type":"pageGesture","data":{"path":"/zoomapp/authorize","fid":1,"lcp":720.299,"cls":0,"tbt":0},"uri":"https://marketplace.zoom.us/zoomapp/authorize?_x_zm_rhtaid=425&_x_zm_rtaid=n_KdqtJRSqiq_0gm0rLnlg.1652792356736.2934a85ffef4d4a3396e95007f554973&client_id=dr0svDgWTCK4rG_GcrObEQ&redirect_uri=https://jayden-1.ngrok.zoom.gc-internal.net/&refreshtoken=true&response_type=code"}]

Are there any required parameters or any other instructions for how to correct use the authorize api?

The o[t] is not a function issue was addressed with SDK 0.14, is that the version you are using?

@Robert.Wallis Using js sdk 0.14 did resolve the error. However, now I am seeing this error page after initiating in-client auth and using the authorize api. I am not seeing any relevant logs/error messages.

I made sure to add the home url to the oauth allow list.

Any ideas?

Hi Jaayden. ‘authorize’ is not a method on the js sdk … yet. Try this:

    zoomSdk.callZoomApi("authorize", <authorizeOptions code_challenge and state>)
      .then((response) => {
        console.log(response);
      })
      .catch((e) => {
        console.log(e);
      });

Next step here btw: You’ll need to register an onAuthorized event listener (with the js sdk) which will receive the authorization code. The rest you do server side (eg swap code for auth token)

If none of the ideas above work, try watching the dev tools network panel during the whole process. Likely there is a call to marketplace that is failing. If you can grab that, feel free to post here

When I switched from zoomSdk.callZoomApi(‘authorize’
to zoomSdk.authorize()
I stopped seeing the generic error and I am now getting a response from authorize. The next issue I am having is I am getting the error message Error: Validation error, please check API parameters.

In the docs, it seems like startAuthorize is the same api with the old name. In the docs it says the parameters are optional but the error message makes it seem like this is not the case.

zoomSdk.callZoomApi("startAuthorize", {
  "state": optional string, provided by developer
  "codeChallenge": optional string, provided by developer
})

Try at minimum calling this method with a second argument equal to an object with a codeChallenge OR code_challenge field

I’m experiencing the same issue that @jaaydenh is experiencing with 0.14.

If I inspect the webview before initiating the auth (with the one client test method) it shows these errors in the marketplace app.

@jon6 Are you calling the API with a code challenge when you see this issue?

Hi @MaxM sorry for the delayed response. We’ve had to put this on the back burner to get to release but I will follow up when we can loop back to this. I believe we did but I will confirm when I look again.

@jon6 Thanks for keeping me posted :slight_smile: