# OAuth with multiple environments not working

**URL:** <https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768>\
**Category:** API and Webhooks\
**Created:** [February 8, 2023, 10:10am UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768 "2023-02-08T10:10:55Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![software2](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@software2](https://devforum.zoom.us/u/software2)\
**Post date:** [February 8, 2023, 10:10am UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768/1 "2023-02-08T10:10:55Z")

</div>

### OAuth2.0 Authorization

**Description**  
We have a Software As A Service product and, when a customer comes on board, they have their own “instance” of the product with its own URL. In the vast majority of cases the URL is a subdomain of our .com domain, i.e. [theircompanyname.ourproduct.com](http://theircompanyname.ourproduct.com). A few like to have it more bespoke to them e.g. [ourproduct.theircompanyname.com](http://ourproduct.theircompanyname.com) which then redirects to [theircompanyname.ourproduct.com](http://theircompanyname.ourproduct.com). My development URL is ourproduct.local.

I’ve been really struggling with the **Redirect URL for OAuth** and **OAuth Allow List**. I’ve tried to follow the documentation in [https://marketplace.zoom.us/docs/guides/auth/oauth/#using-multiple-environments](https://marketplace.zoom.us/docs/guides/auth/oauth/#using-multiple-environments).

The actual redirect URL is /Integration/ZoomAuth, so for [theircompanyname.ourproduct.com](http://theircompanyname.ourproduct.com) this would be [ourproduct.com](https://theircompanyname.ourproduct.com/Integration/ZoomAuth)

I have set the Development Redirect URL to [https://ourproduct.local](https://ourproduct.local) and added this to the OAuth Allow List. This is working fine.

I have set the Production Redirect URL to [https://any.ourproduct.com](https://any.ourproduct.com) as per the documentation and also added this to the OAuth Allow List. I have also added to the OAuth Allow List the bespoke URLs e.g. [https://ourproduct.theirdomain.com](https://ourproduct.theirdomain.com).

For the bespoke URLs, when I navigate to:  
`https://zoom.us/oauth/authorize?response_type=code&client_id= **** &redirect_uri=https://ourproduct.theirdomain.com/Integration/ZoomAuth`  
I get directed to the Zoom login page which is what I would expect.

However, for the domains that should be covered by “any”, when I navigate to  
`https://zoom.us/oauth/authorize?response_type=code&client_id= **** &redirect_uri=https://theircompanyname.ourproduct.com/Integration/ZoomAuth`

I get` {"status":false,"errorCode":4700,"errorMessage":"Invalid redirect url","result":null}`

I can’t see what I’m doing wrong. Any help would be much appreciated.

---

<div class="post-metadata">

**Author:** ![software2](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@software2](https://devforum.zoom.us/u/software2)\
**Post date:** [February 10, 2023, 9:15am UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768/2 "2023-02-10T09:15:54Z")

</div>

I’ve now tried changing the app credentials again but to no avail, still getting the same invalid redirect url message:

```auto
{"status":false,"errorCode":4700,"errorMessage":"Invalid redirect url","result":null}

```

What I’ve tried now is I’ve changed my local development URL to [https://local.sfgmentornet.com](https://local.sfgmentornet.com). As I mentioned in my original post, all but a couple of customers have URLs ending in [sfgmentornet.com](http://sfgmentornet.com) e.g. [staging.sfgmentornet.com](http://staging.sfgmentornet.com), [demo.sfgmentornet.com](http://demo.sfgmentornet.com), {companyname}.sfgmentornet.com etc.  
I now have the following in my app credentials:  
Redirect URL for OAuth (development): [https://any.sfgmentornet.com](https://any.sfgmentornet.com)  
Redirect URL for OAuth (production): [https://any.sfgmentornet.com](https://any.sfgmentornet.com)  
OAuth allow list:  
[https://any.sfgmentornet.com](https://any.sfgmentornet.com)

As far as I can see I have followed the instructions in [https://marketplace.zoom.us/docs/guides/auth/oauth/#using-multiple-environments](https://marketplace.zoom.us/docs/guides/auth/oauth/#using-multiple-environments) to the letter.

Is anyone able to provide me with some assistance with this issue? I’m at the end of my tether!

---

<div class="post-metadata">

**Author:** ![software2](https://avatars.discourse-cdn.com/v4/letter/s/779978/32.png) [@software2](https://devforum.zoom.us/u/software2)\
**Post date:** [February 20, 2023, 9:49am UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768/3 "2023-02-20T09:49:31Z")

</div>

Disappointed that I’ve had no responses… ☹

---

<div class="post-metadata">

**Author:** ![elisa.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/elisa.zoom/32/47836_2.png) [@elisa.zoom](https://devforum.zoom.us/u/elisa.zoom)\
**Post date:** [July 25, 2023, 3:54pm UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768/4 "2023-07-25T15:54:49Z")

</div>

Hi @software2  
Thanks for reaching out to us and I apologize for the lack of responses here!  
I am happy to take a closer look into this issue.  
I have sent you a Private Message so you can share with me more details about your app.  
Cheers,  
Elisa

---

<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:** [July 28, 2024, 7:31am UTC](https://devforum.zoom.us/t/oauth-with-multiple-environments-not-working/82768/5 "2024-07-28T07:31:32Z")

</div>

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