Hey @rich,
Here is whats happening, in your app dashboard you have
https://dev.thetherapy.space/_ajax/?ajax_response=oauth&model=zoom&componentID=external_connections
as your redirect url.
Then when you go to authorize your app:
https://zoom.us/oauth/token?grant_type=authorization_code&code=6Y6x0lVGDt_XXXMxyKRRhOz1obX4Z0I6g&redirect_uri=https://dev.thetherapy.space/_ajax/?ajax_response=oauth&model=zoom&componentID=external_connections
Zoom handles your &model=zoom&componentID=external_connections
as the base URL’s query param, so Zoom is comparing
https://dev.thetherapy.space/_ajax/?ajax_response=oauth&model=zoom&componentID=external_connections
with
https://dev.thetherapy.space/_ajax/?ajax_response=oauth
hence you getting the error:
{
“reason”: “Invalid request : Redirect URI mismatch.”,
“error”: “invalid_request”
}
(I tested having the first query param of ?ajax_response=oauth
works, but when you add another one with &
it breaks.)
This is the case for most OAuth flows including Googles API. (Referencing this stack overflow answer)
That being said,
The correct way to do this, is to add a query param to the end of the authorization url itself, instead of the redirect url.
For example in my App Dashboard I have https://zoom.us
as my redirect url, and then I added a &state=data
query param to the auth url:
https://zoom.us/oauth/authorize?response_type=code&client_id={{ clientID }}&redirect_uri=https://zoom.us&state=somedata
This will take you to https://zoom.us/?code=zoiAoSEm98_KdYKjnimT4KPd8KKdQt9FQ&state=data
.
Then when requesting an access_token, pass I pass in https://zoom.us
as the redirect_url
and it works.
https://zoom.us/oauth/token?code=zoiAoSEm98_KdYKjnimT4KPd8KKdQt9FQ&grant_type=authorization_code&redirect_uri=https://zoom.us
Let me know if this helps!
Thanks,
Tommy