# Getting Invalid Token when system tries to get a new access token for user

**URL:** <https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530>\
**Category:** API and Webhooks\
**Created:** [September 16, 2021, 10:37am UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530 "2021-09-16T10:37:40Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sheharyar](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Sheharyar](https://devforum.zoom.us/u/Sheharyar)\
**Post date:** [September 16, 2021, 10:37am UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/1 "2021-09-16T10:37:40Z")

</div>

Hi, We have a web app where users can connect their zoom account and see their data. They can also create the zoom meeting through our platform.

We are using the Oauth process of zoom. The problem we are facing is user’s token keeps expiring if a new user connects their zoom app with our platform. The token remains valid only for the last user.

As mentioned in the docs, the access token expires after 1 hour. So in order to get a new access token, we send a post request to the following endpoint

`https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=user_refresh_token`

This works fine for the user who has authenticated the zoom app most recently among all user. Bust for all the other users when their token expires and the system tries to refresh their token, then we get 401 error

```auto
{
    "reason": "Invalid Token!",
    "error": "invalid_request"
}

```

Any help? I am facing this issue on both Development and Production Environments.

Also currently my app is not Published yet on zoom marketplace. So i do not know if it is related to that or not.

I have tried to uninstall and reinstall the zoom app as well but no luck.

Any help will be much appreciated.

Thanks!

---

<div class="post-metadata">

**Author:** ![Sheharyar](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Sheharyar](https://devforum.zoom.us/u/Sheharyar)\
**Post date:** [September 16, 2021, 11:38pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/2 "2021-09-16T23:38:37Z")

</div>

Also right now my app is not published yet. So i can only authorize the developer’s zoom account. So all of my test users are basically authorizing the same(developer’s) zoom account. Maybe that is causing the issue?

---

<div class="post-metadata">

**Author:** ![will.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/will.zoom/32/14417_2.png) [@will.zoom](https://devforum.zoom.us/u/will.zoom)\
**Post date:** [September 20, 2021, 1:38pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/3 "2021-09-20T13:38:59Z")

</div>

Hi @Sheharyar,

Is this an account level or user level app?

Once you’ve retrieved an access\_token and refresh it with the refresh\_token that you originally received from our /oauth endpoint, make sure that you’re using the new access\_token that is returned in your refresh request. You will need to update both your access\_token and refresh\_token pairs each time you refresh a token.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![Sheharyar](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Sheharyar](https://devforum.zoom.us/u/Sheharyar)\
**Post date:** [September 20, 2021, 1:55pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/4 "2021-09-20T13:55:58Z")

</div>

Hi @will.zoom

This is an Account level app. Yes, i am saving both Access Token and Refresh token whenever I refresh my token.  
I was wondering maybe it is due to following

`my app is not published yet. So i can only authorize the developer’s zoom account. So all of my test users are basically authorizing the same(developer’s) zoom account`

---

<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:** [September 21, 2021, 9:05pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/5 "2021-09-21T21:05:49Z")

</div>

Hey @Sheharyar,

As you mentioned, the issue here is that you are sharing your developer user across multiple individuals. For each Zoom user, you can only have one “live” token that’s valid. When you request a new token, the old one becomes invalid.

This is because OAuth is meant to be authorized individually. In other words, each person would have their own Zoom User under your account. They would use that Zoom User to install your app and test from there.

Then, token requests for each user won’t conflict. You can learn more in our [OAuth App](https://marketplace.zoom.us/docs/guides/auth/oauth) documentation.

I hope that helps! 🙂

Thanks,  
Max

---

<div class="post-metadata">

**Author:** ![Sheharyar](https://avatars.discourse-cdn.com/v4/letter/s/b5a626/32.png) [@Sheharyar](https://devforum.zoom.us/u/Sheharyar)\
**Post date:** [September 21, 2021, 11:07pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/6 "2021-09-21T23:07:16Z")

</div>

Hi @MaxM

Thanks! That helped and cleared my thoughts,

---

<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:** [September 22, 2021, 9:39pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/7 "2021-09-22T21:39:57Z")

</div>

Hey @Sheharyar,

Great! I’m glad to hear that was helpful. I’ll go ahead and close this topic now but feel free to open a new topic if you encounter any further issues or questions.

Thanks,  
Max

---

<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:** [September 22, 2021, 9:39pm UTC](https://devforum.zoom.us/t/getting-invalid-token-when-system-tries-to-get-a-new-access-token-for-user/57530/8 "2021-09-22T21:39:58Z")

</div>

Closed on September 22, 2021, 9:39pm UTC


