# Randomly receiving "Invalid access token" for Server-to-Server OAuth

**URL:** <https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432>\
**Category:** API and Webhooks\
**Tags:** oauth\
**Created:** [August 17, 2022, 9:24pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432 "2022-08-17T21:24:46Z")\
**Posts on this page:** 19\
**Page:** 2

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [September 15, 2022, 2:30pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/22 "2022-09-15T14:30:56Z")

</div>

For posterity and anyone else who happens to run across this thread while scratching their head about how Server-to-Server OAuth works:

1. Requesting a new Server-to-Server OAuth token invalidates the previous one.
2. Zoom can increase the “index” count for your account, allowing you to request different tokens with different indexes that do not interfere with each other (i.e. requesting a token for index 1 doesn’t invalidate the token requested for index 2).
3. The token index is specified in the call to [https://zoom.us/oauth/token](https://zoom.us/oauth/token) by passing the `token_index` query parameter ([https://zoom.us/oauth/token?token\_index=2](https://zoom.us/oauth/token?token_index=2))

This should allow folks to build out a background oauth token rotation strategy where the token is updated in a central place, using a new index value (e.g. database, AWS SSM or secrets manager, etc.) allowing applications to continue using the previous token until they can read the new value from the central location.

---

<div class="post-metadata">

**Author:** ![framework](https://avatars.discourse-cdn.com/v4/letter/f/a88e4f/32.png) [@framework](https://devforum.zoom.us/u/framework)\
**Post date:** [January 20, 2023, 4:12pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/23 "2023-01-20T16:12:02Z")

</div>

Hello @elisa.zoom ,

We are having the same issues, can you help please?  
I created this ticket: [https://support.zoom.us/hc/en-us/requests/16360848](https://support.zoom.us/hc/en-us/requests/16360848)

---

<div class="post-metadata">

**Author:** ![onemancat](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@onemancat](https://devforum.zoom.us/u/onemancat)\
**Post date:** [January 31, 2023, 3:27pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/24 "2023-01-31T15:27:06Z")

</div>

Hello,  
I am having the same issue and would the like the index for our server to server app to be increased to 6.  
I had opened this ticket [https://support.zoom.us/hc/en-us/requests/16423969](https://support.zoom.us/hc/en-us/requests/16423969) but was asked to post to the dev forum first. Please let me know how long this will take to resolve.  
Also wanted to know if there is limit to the number of server to server oauth apps I can have on our account?  
Sumit

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [January 31, 2023, 3:55pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/25 "2023-01-31T15:55:23Z")

</div>

I can’t help with increasing your limit, but I can say that the index is the limit to the number of oauth tokens you can have active at one time. We had to build a token rotation service that would flip between two indexes. We allocated some indexes to our dev environment and some to our prod.

---

<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:** [January 31, 2023, 4:41pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/26 "2023-01-31T16:41:32Z")

</div>

Developer Support limited me to [3 concurrent index values](https://devforum.zoom.us/t/server-to-server-oauth-annoying-token-invalidation/72070/8). If you need more than that, my recommendation is to create multiple identical Server-to-Server OAuth applications corresponding to the number of concurrent tokens you need (each application represents 1 index value).

---

<div class="post-metadata">

**Author:** ![onemancat](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@onemancat](https://devforum.zoom.us/u/onemancat)\
**Post date:** [January 31, 2023, 6:04pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/27 "2023-01-31T18:04:56Z")

</div>

I was hoping to get 2 tokens per environment (3 environments). I thought I read in this post that someone’s index tolerance was increased to 5.  
@david5 , can you share some details on the service you created?

---

<div class="post-metadata">

**Author:** ![david5](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/david5/32/40553_2.png) [@david5](https://devforum.zoom.us/u/david5)\
**Post date:** [January 31, 2023, 8:32pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/28 "2023-01-31T20:32:45Z")

</div>

@onemancat We run in AWS, so we wrote an AWS lambda function that is triggered on a schedule (every 50 minutes). The function updates a secret stored in AWS Secrets Manager. We store the oauth token, the index used to generate the token and the timestamp the token was generated. The Lambda function increments the index (circularly within a range), generates a new token and updates Secrets Manager.

The services that need to make Zoom API calls look up the Secrets Manager value and use the token within to make the API calls. They also use the timestamp value to determine when they should go back to Secrets Manager to look for a new token.

---

<div class="post-metadata">

**Author:** ![onemancat](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@onemancat](https://devforum.zoom.us/u/onemancat)\
**Post date:** [January 31, 2023, 8:51pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/29 "2023-01-31T20:51:31Z")

</div>

Thanks so much. That makes sense.

---

<div class="post-metadata">

**Author:** ![onemancat](https://avatars.discourse-cdn.com/v4/letter/o/d78d45/32.png) [@onemancat](https://devforum.zoom.us/u/onemancat)\
**Post date:** [February 1, 2023, 4:35pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/30 "2023-02-01T16:35:41Z")

</div>

Hello @elisa.zoom ,  
Will you or someone else be able to help me with my request?  
Sumit  
The request post above:  
Hello,  
I am having the same issue and would the like the index for our server to server app to be increased to 6.  
I had opened this ticket [https://support.zoom.us/hc/en-us/requests/16423969](https://support.zoom.us/hc/en-us/requests/16423969) but was asked to post to the dev forum first. Please let me know how long this will take to resolve.  
Also wanted to know if there is limit to the number of server to server oauth apps I can have on our account?  
Sumit

---

<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:** [February 1, 2023, 4:40pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/31 "2023-02-01T16:40:06Z")

</div>

> [@onemancat](#):
>
> [16423969](https://support.zoom.us/hc/en-us/requests/16423969)

Hi @onemancat  
Normally our support team will help you with this issue, but I am happy to help.  
There is no limit to the number of server to server OAuth apps that you can have in your account.

---

<div class="post-metadata">

**Author:** ![ziegenberg](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/ziegenberg/32/15748_2.png) [@ziegenberg](https://devforum.zoom.us/u/ziegenberg)\
**Post date:** [May 25, 2023, 1:51pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/32 "2023-05-25T13:51:49Z")

</div>

Hi @elisa.zoom!

I opened request [https://support.zoom.us/hc/en-us/requests/17290984](https://support.zoom.us/hc/en-us/requests/17290984) and they closed it on my, redirecting me to [https://devforum.zoom.us](https://devforum.zoom.us).

Can you help me?

kind regards,  
Daniel

---

<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:** [May 31, 2023, 8:05pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/33 "2023-05-31T20:05:30Z")

</div>

> [@ziegenberg](#):
>
> [17290984](https://support.zoom.us/hc/en-us/requests/17290984)

I am taking a look into this @ziegenberg

---

<div class="post-metadata">

**Author:** ![pooja.t\_zoomtesting](https://avatars.discourse-cdn.com/v4/letter/p/858c86/32.png) [@pooja.t\_zoomtesting](https://devforum.zoom.us/u/pooja.t_zoomtesting)\
**Post date:** [June 12, 2023, 7:13am UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/34 "2023-06-12T07:13:51Z")

</div>

Hello @elisa.zoom ,

I am having the same issue and would like the index for our server to server app to be increased to 2 atleast.  
I had opened this ticket- [https://support.zoom.us/hc/en-us/requests/17415534](https://support.zoom.us/hc/en-us/requests/17415534) but was asked to post to the dev forum .

Will you or someone else be able to help me with my request?

---

<div class="post-metadata">

**Author:** ![kfrymire](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/kfrymire/32/49334_2.png) [@kfrymire](https://devforum.zoom.us/u/kfrymire)\
**Post date:** [June 12, 2023, 7:58pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/35 "2023-06-12T19:58:23Z")

</div>

Hello @elisa.zoom  
We have converted our JWT app to Server-to-server Oauth and are now experiencing random “Invalid access token” errors even though the token is definitely not expired. Our app runs on multiple servers behind a load balancer. We’ve tried keeping the token in a shared Redis db (accessible by all servers) or multiple access tokens stored locally on each server, but in either case we still get random “invalid access token” error messages.

---

<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:** [June 14, 2023, 7:42pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/36 "2023-06-14T19:42:00Z")

</div>

Hi @kfrymire  
Thanks for reaching out to us and welcome to our community!  
Can you please make sure you are not generating more than 1 token at the same time? As of right now the expected behavior is that when you generate a new token, the previous one will be invalidated and you will be getting the “invalid access token” error

---

<div class="post-metadata">

**Author:** ![yuvya](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/yuvya/32/42398_2.png) [@yuvya](https://devforum.zoom.us/u/yuvya)\
**Post date:** [July 26, 2023, 1:42pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/37 "2023-07-26T13:42:09Z")

</div>

> [@david5](#):
>
> s a new token and updates Secrets Manager.
> 
> The services that need to make Zoom API calls loo

Recent Zoom Developer Newsletter (July 2023) says the issue does not exist anymore, so when generating a new access\_token, it does not invalidates older tokens that are still not expired.

Here is then quote from the newsletter:

> ### Multi-Access Tokens Available in Server-to-Server OAuth
> 
> The new Multiple Access Tokens feature allows you to generate multiple tokens for a server to server OAuth app without invalidating the previous tokens. This means you no longer need to use the “index” parameter in your query to generate multiple tokens. If you are using the index query parameter, it will be ignored, but your token will still be generated.

---

<div class="post-metadata">

**Author:** ![sgahaghan](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/sgahaghan/32/14990_2.png) [@sgahaghan](https://devforum.zoom.us/u/sgahaghan)\
**Post date:** [September 25, 2023, 3:28pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/38 "2023-09-25T15:28:02Z")

</div>

Has the “Multi-Access Tokens Available in Server-to-Server OAuth” feature been implemented in ZoomGov?

I am still getting the “invalid access token” with the ZoomGov api.

Thanks

---

<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:** [September 25, 2023, 6:55pm UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/39 "2023-09-25T18:55:15Z")

</div>

Hi @sgahaghan  
I am not aware if this has been implemented for Zoom for Gov, but let me look into this and will get back to you

---

<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:** [September 28, 2024, 10:32am UTC](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/40 "2024-09-28T10:32:01Z")

</div>

Closed on September 28, 2024, 10:32am UTC

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

[Previous page](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432.md?page=1)
