# Multiple Environment Callback not working for OAuth App

**URL:** <https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743>\
**Category:** API and Webhooks\
**Created:** [January 17, 2022, 7:46am UTC](https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743 "2022-01-17T07:46:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![khanmdmudassir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/khanmdmudassir/32/18223_2.png) [@khanmdmudassir](https://devforum.zoom.us/u/khanmdmudassir)\
**Post date:** [January 17, 2022, 7:46am UTC](https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743/1 "2022-01-17T07:46:57Z")

</div>

## Using this template helps us debug your issues more effectively 🙂

**Description**  
As mentioned in the below link,  
[https://marketplace.zoom.us/docs/guides/auth/oauth#using-multiple-environments](https://marketplace.zoom.us/docs/guides/auth/oauth#using-multiple-environments)  
I’m trying to use the same OAuth App for multiple env. e.g. [cust1.app.domain.com](http://cust1.app.domain.com), [cust2.app.domain.com](http://cust2.app.domain.com). I have added the callback url as “[any.app.domain.com](http://any.app.domain.com)”.

**Error**  
We I try to redirect to cust2.app.domain, then I get following error:  
`{"status":false,"errorCode":4700,"errorMessage":"Invalid redirect url","result":null}`

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

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

**How To Reproduce (If applicable)**  
Steps to reproduce the behavior:

1. Create an OAuth App
2. Add redirect url as “[http://any.app.domain.com/callbackurl](http://any.app.domain.com/callbackurl)”
3. Now test the Installation URL  
[https://zoom.us/oauth/authorize?client\_id={client\_id}&response\_type=code&redirect\_uri=http%3A%2F%2Fcust1.app.domain.com%3A8080%2Fcallbackurl](https://zoom.us/oauth/authorize?client_id=%7Bclient_id%7D&response_type=code&redirect_uri=http%3A%2F%2Fcust1.app.domain.com%3A8080%2Fcallbackurl)

**Additional context**  
If we add [cust1.app.domain.com](http://cust1.app.domain.com) in allow lists then it works.

---

<div class="post-metadata">

**Author:** ![khanmdmudassir](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/khanmdmudassir/32/18223_2.png) [@khanmdmudassir](https://devforum.zoom.us/u/khanmdmudassir)\
**Post date:** [January 19, 2022, 7:41am UTC](https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743/2 "2022-01-19T07:41:15Z")

</div>

I got it working. After reading below post by @tommy

> [@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…

The mistake I was making was not including the domain (i.e. [app.domain.com](http://app.domain.com)) in whitelist url.

Thanks! 🙂

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 24, 2022, 11:53pm UTC](https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743/3 "2022-01-24T23:53:37Z")

</div>

I’m glad to hear that you were able to solve the issue @khanmdmudassir! Thanks for sharing your solution here.

---

<div class="post-metadata">

**Author:** ![MaxM](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/maxm/32/42303_2.png) [@MaxM](https://devforum.zoom.us/u/MaxM)\
**Post date:** [January 24, 2022, 11:53pm UTC](https://devforum.zoom.us/t/multiple-environment-callback-not-working-for-oauth-app/62743/4 "2022-01-24T23:53:43Z")

</div>


