# '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:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![Nad](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@Nad](https://devforum.zoom.us/u/Nad)\
**Post date:** [August 3, 2020, 4:39pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/1 "2020-08-03T16:39:06Z")

</div>

**Description**  
Hi all, I am trying to integrate zoom into an app I’m developing, but I have been stuck on this error for 2 days: ‘Invalid request : Redirect URI mismatch.’

I am developing the app on localhost and used ngrok and white-listed the re-direct urls as recommended. However, despite doing all that, I am still getting this error and can’t seem to identify the cause of this. Would greatly appreciate your help if you can tell me what I am doing wrong! 😀

This is my app link: [https://zoom.us/oauth/authorize?response\_type=code&client\_id=uhZaUDEvQiewpSECmxZPkg&redirect\_uri=https%3A%2F%2F187929699399.ngrok.io%2Fzoom%2Fget-access-token](https://zoom.us/oauth/authorize?response_type=code&client_id=uhZaUDEvQiewpSECmxZPkg&redirect_uri=https%3A%2F%2F187929699399.ngrok.io%2Fzoom%2Fget-access-token)

**Error**  
{ reason: ‘Invalid request : Redirect URI mismatch.’,  
error: ‘invalid\_request’ } },

**Which App Type (OAuth / Chatbot / JWT / Webhook)?**  
OAuth

**Which Endpoint/s?**  
[https://zoom.us/oauth/token](https://zoom.us/oauth/token)

**How To Reproduce (If applicable)**

1. Successfully obtained authorization\_code in step 1
2. Redirect to [https://187929699399.ngrok.io/zoom/get-access-token](https://187929699399.ngrok.io/zoom/get-access-token) successfully
3. Perform post request:

[https://zoom.us/oauth/token?grant\_type=authorization\_code&code=5GZyeq2Oii\_HkO8eriES-OrrKvKAtUKaw&redirect\_uri=https://187929699399.ngrok.io/zoom/authorization-success](https://zoom.us/oauth/token?grant_type=authorization_code&code=5GZyeq2Oii_HkO8eriES-OrrKvKAtUKaw&redirect_uri=https://187929699399.ngrok.io/zoom/authorization-success)

1. Receive ‘Invalid request : Redirect URI mismatch.’ error

**Screenshots (If applicable)**

List of redirect urls in white-list:

- [https://187929699399.ngrok.io/zoom/authorization-success](https://187929699399.ngrok.io/zoom/authorization-success)
- [https://187929699399.ngrok.io/zoom/get-access-token](https://187929699399.ngrok.io/zoom/get-access-token)
- [https://187929699399.ngrok.io/zoom/authorization-success/](https://187929699399.ngrok.io/zoom/authorization-success/)
- [https://187929699399.ngrok.io](https://187929699399.ngrok.io)
- [https://187929699399.ngrok.io/](https://187929699399.ngrok.io/)

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 3, 2020, 4:39pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/2 "2020-08-03T16:39:10Z")

</div>

Hey @Nad

Thanks for posting on the Zoom Devforum! I am still learning, but I will try my best to help answer your question. 🙂

Checkout these related threads that may have the answer you are looking for:

> [@Getting Invalid request : Redirect URI mismatch error](https://devforum.zoom.us/t/-/10484):
>
> Description I’m getting a Redirect URI mismatch error when trying to get an access token after getting the code. It’s probably because I misunderstood how redirect URI works. I tried the following: Exact same URI as in app settings Same URI that I provided in oauth/authorize call when getting the code I’m getting the same error every time. Error { “reason”: “Invalid request : Redirect URI mismatch.”, “error”: “invalid\_request” } Which App Type (OAuth / Chatbot / JWT / Webhook)? OAut…

> [@Persistent "Redirect URI mismatch" error](https://devforum.zoom.us/t/-/12097):
>
> Description When making the POST request to obtain the access and refresh tokens, I keep receiving a 403 status code, with the “Redirect URI mismatch” error. Error {“reason”:“Invalid request : Redirect URI mismatch.”,“error”:“invalid\_request”} Which App Type (OAuth / Chatbot / JWT / Webhook)? OAuth2 Which Endpoint/s? [https://zoom.us/oauth/token](https://zoom.us/oauth/token) Additional context I’m stuck at step 2 of OAuth2 authorization. I have obtained the authorization code from step 1, and now I’m calling the endp…

> [@OAuth with zoom - redirect uri is not used for redirect](https://devforum.zoom.us/t/-/4843):
>
> Hi, I’m currently working on an OAuth application with Zoom. Here the error occurs that the redirect Uri I specified is not accepted, but I am sent back to the zoom page. My Request URL: [https://zoom.us/oauth/authorize?client\_id=XXX&response\_type=code&redirect\_uri=http://localhost:8080/vccfg/login/oauth2/code/zoom&state=XXX](https://zoom.us/oauth/authorize?client_id=XXX&response_type=code&redirect_uri=http://localhost:8080/vccfg/login/oauth2/code/zoom&state=XXX) Location I get send to after the request: [http://zoom.us/vccfg/login/oauth2/code/zoom?code=XXX](http://zoom.us/vccfg/login/oauth2/code/zoom?code=XXX) Screenshot from my browser:

If these threads did not help, please let us know by replying back here and someone from the Developer Relations team will get back to you shortly.

Thanks,  
DeveloperBot

---

<div class="post-metadata">

**Author:** ![Nad](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@Nad](https://devforum.zoom.us/u/Nad)\
**Post date:** [August 3, 2020, 4:59pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/3 "2020-08-03T16:59:00Z")

</div>

Hi thank you, I have read the threads above but still can’t identify the problem 🙂

Edit: I used the same redirect url in [https://zoom.us/oauth/authorize](https://zoom.us/oauth/authorize)? and [https://zoom.us/oauth/token](https://zoom.us/oauth/token), and managed to get the access token, but don’t really understand why

---

<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

---

<div class="post-metadata">

**Author:** ![Nad](https://avatars.discourse-cdn.com/v4/letter/n/ed8c4c/32.png) [@Nad](https://devforum.zoom.us/u/Nad)\
**Post date:** [August 5, 2020, 9:16am UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/5 "2020-08-05T09:16:38Z")

</div>

@tommy Many thanks, it was very clear 😄

---

<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 6, 2020, 6:56pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/6 "2020-08-06T18:56:48Z")

</div>

You are welcome! 🙂

-Tommy

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [August 16, 2020, 6:57pm UTC](https://devforum.zoom.us/t/invalid-request-redirect-uri-mismatch-despite-using-ngrok/26106/7 "2020-08-16T18:57:01Z")

</div>

Closed on August 16, 2020, 6:57pm UTC

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.
