# Concurrency issue in Server to server OAUTH APP token gets expired

**URL:** <https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256>\
**Category:** API and Webhooks\
**Tags:** s2s-oauth\
**Created:** [April 7, 2023, 5:58am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256 "2023-04-07T05:58:43Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![alroya](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@alroya](https://devforum.zoom.us/u/alroya)\
**Post date:** [April 7, 2023, 5:58am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/1 "2023-04-07T05:58:43Z")

</div>

Hi As JWT APP is getting deprecated we are migrating to Server to server OAuth APP

Sometimes randomly we come across an issue

124- Invalid access token during our API calls

it may be due to concurrent API calls as multiple API calls getting hit simultaneously so token is getting invalid  
i have read about some articles we need to increase token\_index of our APP which can be used in [https://zoom.us/oauth/token](https://zoom.us/oauth/token) API

What is the max limit count for token\_index for OAUTH token API ?  
Who should we contact to increase our token\_index limit?

Please send me some documentation of how this token\_index works in OAUTH token API and how it should be implemented.

or is there another workaround for this issue?

Please reply urgently

---

<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:** [April 7, 2023, 7:19pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/2 "2023-04-07T19:19:24Z")

</div>

Hi @alroya  
Thanks for reaching out to the Zoom Developer Forum, I am happy to help here!  
This invalid access token issue you are seeing could be due to the concurrent API calls that you are generating; what I mean by this is that when you generate a new access token, the previous one will get invalidated.  
A workaround for this issue is increasing your token\_index tolerance or also creating different apps for different purposes.

Hope this helps,  
Elisa

---

<div class="post-metadata">

**Author:** ![alroya](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@alroya](https://devforum.zoom.us/u/alroya)\
**Post date:** [April 10, 2023, 5:09am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/3 "2023-04-10T05:09:08Z")

</div>

Hi @elisa.zoom  
What is the max value of token\_index tolerance?  
Who should i contact to increase token\_index tolerance of my application?

Can you please provide me with some documentation regarding this token\_index tolerance implementation?

---

<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:** [April 10, 2023, 2:16pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/4 "2023-04-10T14:16:22Z")

</div>

Hi @alroya  
You will have to reach out to our support team here:  
[https://support.zoom.us/hc/en-us](https://support.zoom.us/hc/en-us)

And they will help you with this.  
I am not aware of the max value of the token\_index tolerance but support will be able to provide you with that information.  
Cheers,  
Elisa

---

<div class="post-metadata">

**Author:** ![alroya](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@alroya](https://devforum.zoom.us/u/alroya)\
**Post date:** [April 10, 2023, 2:58pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/5 "2023-04-10T14:58:48Z")

</div>

Hi,  
Can anyone help with max value of the token\_index tolerance for the OAUTH APP?  
Regards,  
Alroy Alvares

---

<div class="post-metadata">

**Author:** ![MultiplayerSession](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/multiplayersession/32/66446_2.png) [@MultiplayerSession](https://devforum.zoom.us/u/MultiplayerSession)\
**Post date:** [April 11, 2023, 6:33pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/6 "2023-04-11T18:33:10Z")

</div>

In my case, I was limited to 3 `token_index` values (but testing still only accepted the default value of 1 for that parameter, so no impact from working with support), which wasn’t enough to cover two environments anyway, so I ended up creating multiple identical applications. In theory, you can negotiate for higher limits if you have what they called “a genuine business impacting use case” to counter the “higher security risk of having more index token [values]”.

---

<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:** [April 11, 2023, 6:50pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/7 "2023-04-11T18:50:15Z")

</div>

Hi @MultiplayerSession  
Thanks for sharing that with the community.  
I am just curious about your case, where you can not use the token\_index … I am happy to take a look into this for you.  
If you have a support ticket number that you could share with me or I am happy to troubleshoot it

---

<div class="post-metadata">

**Author:** ![alroya](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@alroya](https://devforum.zoom.us/u/alroya)\
**Post date:** [April 12, 2023, 6:23am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/8 "2023-04-12T06:23:09Z")

</div>

Hi @elisa.zoom,

My ticket number is #16998355 . Please check this out also

Regards,  
Alroy Alvares

---

<div class="post-metadata">

**Author:** ![alroya](https://avatars.discourse-cdn.com/v4/letter/a/eb9ed0/32.png) [@alroya](https://devforum.zoom.us/u/alroya)\
**Post date:** [April 12, 2023, 6:26am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/9 "2023-04-12T06:26:31Z")

</div>

Hi @MultiplayerSession

Thank you for your help,

if there are multiple User how will it work if oauth token is getting expired for eg  
One user is creating Zoom meeting via API and other is deleting another zoom meeting at same time then the firt token will get invalidated.

JWT app was not having this issue. so this migration to server to serve oauth is having this drawback

Regards,  
Alroy Alvares

---

<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:** [April 12, 2023, 12:08pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/10 "2023-04-12T12:08:48Z")

</div>

> [@alroya](#):
>
> 16998355

I will take a look into this @alroya

---

<div class="post-metadata">

**Author:** ![MultiplayerSession](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/multiplayersession/32/66446_2.png) [@MultiplayerSession](https://devforum.zoom.us/u/MultiplayerSession)\
**Post date:** [April 12, 2023, 4:07pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/11 "2023-04-12T16:07:50Z")

</div>

@alroya You have two valid (from Zoom’s perspective) tokens simultaneously (either via separate `token_index` values or different applications), but only one of them is in active use by your application at a given time. If you have a shared database, it can decide which one is in active use. You renew and perform maintenance on the token that is inactive, then swap it into active use for your application. Other processes can continue using the previous active token because it’s still valid from Zoom’s perspective, so they don’t need to notice the new token immediately. I’ve written more about this concept of a [key rotation strategy](https://devforum.zoom.us/t/server-to-server-oauth-annoying-token-invalidation/72070/13) in other threads.

@elisa.zoom I was getting a [HTTP 400 response code with the body `{"reason":"Invalid request : Maximum group number limit exceeded","error":"invalid_request"}`](https://devforum.zoom.us/t/server-to-server-oauth-annoying-token-invalidation/72070/8) whenever I raised the `token_index` above `0`, but I’d invested 2 months into support ticket #14947692 and decided it was no longer worth the effort to troubleshoot further when anyone can just create multiple duplicate applications without Zoom’s prior approval (which is what the first backend engineer’s reply to that ticket recommended doing anyway) for functionality that should be available by default. Don’t worry about it; we needed 4 valid tokens anyway to share across 2 environments, and I don’t anticipate switching back to using `token_index` and coming up with a persuasive “genuine business impacting use case” at this point to make that happen.

---

<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:** [April 12, 2023, 10:20pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/12 "2023-04-12T22:20:39Z")

</div>

@MultiplayerSession  
Sorry to hear that Chris, I will take a look just to understand what happened and I will communicate back with you. Please let me know if there is anything else I could do for you

---

<div class="post-metadata">

**Author:** ![michael.williams1](https://avatars.discourse-cdn.com/v4/letter/m/f9ae1b/32.png) [@michael.williams1](https://devforum.zoom.us/u/michael.williams1)\
**Post date:** [May 17, 2023, 7:24am UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/13 "2023-05-17T07:24:34Z")

</div>

I am also having the same problem, please help. Support ticket #17239044

---

<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:** [May 19, 2024, 11:01pm UTC](https://devforum.zoom.us/t/concurrency-issue-in-server-to-server-oauth-app-token-gets-expired/86256/14 "2024-05-19T23:01:27Z")

</div>

Closed on May 19, 2024, 11:01pm UTC

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