# 'Invalid request : Redirect URI mismatch.' despite using ngrok

**URL:** <https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106>\
**Category:** API and Webhooks\
**Created:** [August 3, 2020, 4:39pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106 "2020-08-03T16:39:06Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![tommy](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/tommy/32/72769_2.png) [@tommy](https://devforum.zoom.us/u/tommy)\
**Post date:** [August 4, 2020, 8:34pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/4 "2020-08-04T20:34:53Z")

</div>

Hey @Nad,

Let me know if this helps explain things:

* * *

The Redirect URI needs to be the same URI from the authorization (install URL) through to the Get Access Token request. So with these URLs set:

 ![Screen Shot 2020-07-23 at 10.02.37 AM](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/2X/7/75b1938e39983bd1537e99dc0ec0f2b9769c9d51.png)

When I go to install the app from the “Activation” page, it defaults the redirect URI to the one specified in the “Redirect URL for OAuth” input:

`https://zoom.us/oauth/authorize?response_type=code&client_id=ztmR8sxaSBGZ66b5laR7Ag&redirect_uri=https://zoom.us`

So if I proceed to install the app, the redirect uri needs to be exactly [https://zoom.us](https://zoom.us) for the get access token request or else you will see the `Redirect URI mismatch error`

**That being said** , if from the start with the same settings above, I add the `/meetings` path to the authorize install url:

`https://zoom.us/oauth/authorize?response_type=code&client_id=ztmR8sxaSBGZ66b5laR7Ag&redirect_uri=https://zoom.us/meeting`

And then after I get the auth code, I make the access token request and set the redirect uri to the same as the one in the install url `https://zoom.us/meeting` it will work.

Does that make sense? So you can have dynamic redirect urls, but they need to be the same for both the [authorize url](https://marketplace.zoom.us/docs/guides/auth/oauth#step-1-request-user-authorization) and the [get access token url](https://marketplace.zoom.us/docs/guides/auth/oauth#step-2-request-access-token) requests.

More details here on how to handle this in your code:

> [@Does zoom support more than two environments for oauth2?](https://devforum.zoom.us/t/does-zoom-support-more-than-two-environments-for-oauth2/11052/12):
>
> Hey @tuancode, @michael.solomon, This is totally possible! slight_smile Let me walk you through how to do this with the base domain of example.com For your whitelist, simply add your base domain: https://example.com Then in your dev/prod redirect url field, add a default redirect, https://any.example.com (this will be programmatically overridden to the correct sub domain, continue reading below) Now, with your install URL ([the url mentioned in Step 1. of the OAuth guide](https://marketplace.zoom.us/docs/guides/auth/oauth#getting-access-token)) in your code, dyna…

* * *

Thanks,  
Tommy

---

_[View the full topic](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106)._
