# Refresh Token expires after few hours when ever we need to get Access Token

**URL:** <https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464>\
**Category:** API and Webhooks\
**Created:** [November 9, 2020, 11:19am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464 "2020-11-09T11:19:54Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![fayazvar.mobile](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fayazvar.mobile/32/16944_2.png) [@fayazvar.mobile](https://devforum.zoom.us/u/fayazvar.mobile)\
**Post date:** [November 9, 2020, 11:19am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/1 "2020-11-09T11:19:54Z")

</div>

I have created an OAuth App using a free account, I am able to generate Meeting ID using Access Token, but my Refresh Token gets expired after a few hours.

**Error**  
Refresh Token becomes invalid.

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

Steps to reproduce the behavior:

1. Request URL / Headers (without credentials) / Body
2. See error

Thanks  
Fayaz

---

<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:** [November 10, 2020, 7:26pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/4 "2020-11-10T19:26:14Z")

</div>

Hey @fayazvar.mobile,

To clarify, [refresh tokens](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing) expire after 1 hour:

 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/3/13916d5f3cdbbdc74e2e3d381078e194735547c4.png)

You will need to follow the guide linked above to refresh your token periodically.

Thanks,  
Will

---

<div class="post-metadata">

**Author:** ![fayazvar.mobile](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fayazvar.mobile/32/16944_2.png) [@fayazvar.mobile](https://devforum.zoom.us/u/fayazvar.mobile)\
**Post date:** [November 12, 2020, 4:41am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/5 "2020-11-12T04:41:40Z")

</div>

Hey @will.zoom

So you mean I have to keep one service running for life long to refresh my “ **Access Token** ” using “ **Refresh Token** ” but practically I don’t think it is the case. I could use my “Refresh Token” to generate an “Access Token” even after 24 hours.

My actual problem is if I provide the wrong “ **Refresh Token** ” to get “ **Access Token** ” using the following link [https://zoom.us/oauth/token?grant\_type=refresh\_token&refresh\_token=](https://zoom.us/oauth/token?grant_type=refresh_token&refresh_token=)…  
I am getting an error, but after that, if I use the correct “ **Refresh Token** ” that even does not return “ **Access Token** ”, it is like i lost my single chance, there should be some kind of limit how many times i can provide wrong “ **Refresh Token** ”.

Regards,  
Fayaz

---

<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:** [November 12, 2020, 8:22pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/6 "2020-11-12T20:22:04Z")

</div>

Hey @fayazvar.mobile,

It sounds like you _may_ be using an outdated refresh token each time. Note that each time you request an access token, both a new token and refresh token are provided, and you’ll need to store these latest values each time.

Please try generating a new access\_token **and** refresh\_token, and then try the new refresh\_token value. Make sure to use the new access and refresh tokens each refresh.

Let me know if this helps to clarify,  
Will

---

<div class="post-metadata">

**Author:** ![fayazvar.mobile](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fayazvar.mobile/32/16944_2.png) [@fayazvar.mobile](https://devforum.zoom.us/u/fayazvar.mobile)\
**Post date:** [November 13, 2020, 5:22am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/7 "2020-11-13T05:22:38Z")

</div>

Hey @will.zoom,

Yes, whenever I get a new **Access Token** , the same time I am getting a new **Refresh Token** also, I save that **Refresh Token** in a Database, next time when I fetch a new **Access Token** , I use that stored **Refresh Token**. Problem is when i hit Zoom API to get new **Access Token** , if by mistake i sent wrong **Refresh Token** inside the request, i will get error message as “Access Denide”. i should have atleast 3 chances to send wrong **Refresh Token** to get new **Access Token**. If i send Wrong Refresh Token, actual Refresh Token from zoom side should not get invalid unless my 3 chances are over.

Thanks  
**Fayaz**

---

<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:** [November 13, 2020, 11:24pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/8 "2020-11-13T23:24:32Z")

</div>

Hey @fayazvar.mobile,

Thanks for your feedback. We are aware of this limitation of our OAuth flow where [latest refresh token](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing) must always be used for the next refresh request. In some cases we provide a higher refresh tolerance for apps that have trouble keeping the most recent refresh token up to date. Please let us know why your system fails to update the refresh token each time and we will consider increasing your tolerance to 2 or 3.

Thanks,  
Tommy

---

<div class="post-metadata">

**Author:** ![fayazvar.mobile](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fayazvar.mobile/32/16944_2.png) [@fayazvar.mobile](https://devforum.zoom.us/u/fayazvar.mobile)\
**Post date:** [November 14, 2020, 2:58pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/9 "2020-11-14T14:58:00Z")

</div>

Hey @tommy,

Concurrency issue, My API which gets “ **Access Token** ” then uses that “ **Access Token** ” to get new “ **Meeting ID** ” is being used by many users. Flow is

1. Get Stored “ **Refresh Token** ” from Database.
2. Use that “ **Refresh Token** ” to fetch the latest “ **Access Token** ” from Zoom Portal/ Zoom Hosted App.
3. Store this new “ **Refresh Token** ” into the Database.

Any of these Processes can take time depends on internet speed. During the same time if another user starts the above process, So he is providing the wrong “ **Refesh Token** ” to the Zoom API. This creates a huge issue, because in real sense we don’t have now “ **Refresh Token** ”, so we can never get “ **Access Token** ”. We need to authorize the Zoom hosted App again, it becomes a **manual process** then.

Best Regards,  
**Fayaz**

---

<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:** [November 16, 2020, 11:40pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/10 "2020-11-16T23:40:01Z")

</div>

Hey @fayazvar.mobile,

Thanks for sharing this. Can I ask why two different Zoom users would be using the same access / refresh tokens though?

-Tommy

---

<div class="post-metadata">

**Author:** ![fayazvar.mobile](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/fayazvar.mobile/32/16944_2.png) [@fayazvar.mobile](https://devforum.zoom.us/u/fayazvar.mobile)\
**Post date:** [November 17, 2020, 11:33am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/11 "2020-11-17T11:33:36Z")

</div>

Hey @tommy,

Because both will use our same Angular Web App. So we will have a single Account for our Angular Web App. In fact, one department will use one Zoom Account. All of them can use it together. BTW none of the users is directly a zoom user, Only our Angular Web App is a zoom user.

Thanks  
Fayaz

---

<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:** [November 18, 2020, 10:37pm UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/12 "2020-11-18T22:37:43Z")

</div>

Hey @fayazvar.mobile,

I see, so it is basically a service account. 🙂

You have 2 options then:

1. [Refresh the Access Token](https://marketplace.zoom.us/docs/guides/auth/oauth#refreshing) when someone needs to use the app, and the token is expired.

2. Always direct users to the [authorize URL](https://marketplace.zoom.us/docs/guides/auth/oauth#step-1-request-user-authorization), so you can just get a new access token every time.

In the future, we will support multiple active OAuth tokens per user to enhance the flow where the user needs to OAuth on multiple devices.

Thanks,  
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:** [December 19, 2020, 8:37am UTC](https://devforum.zoom.us/t/refresh-token-expires-after-few-hours-when-ever-we-need-to-get-access-token/35464/13 "2020-12-19T08:37:57Z")

</div>

Closed on December 19, 2020, 8:37am UTC

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