# Issue migrating JWT to Server-to-Server OAuth

**URL:** <https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340>\
**Category:** API and Webhooks\
**Tags:** server-to-server\
**Created:** [January 30, 2023, 3:51pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340 "2023-01-30T15:51:36Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![john.cunningham](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@john.cunningham](https://devforum.zoom.us/u/john.cunningham)\
**Post date:** [January 30, 2023, 3:51pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/1 "2023-01-30T15:51:36Z")

</div>

I’m getting random 401 errors using Server-To-Server OAuth when paging thru results from the report/meetings/meeting.uuid/participants endpoint.

I have a list of zoom meetings (size in the hundreds). For each meeting, I’m calling the /participants endpoint. With Server-to-Server OAuth, I get occasional 401 errors causing an incorrect list of participants. This seems to affect about half the meetings in my list, but it fluctuates with each try. Using JWT, I’m able to consistently get participants for all meetings. My source code is identical for both authentication methods. The only difference is the method to generate the bearer token in the HTTP request.

Can someone please assist? Thank you in advance!

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [January 30, 2023, 9:14pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/2 "2023-01-30T21:14:31Z")

</div>

Hi @john.cunningham ,

We don’t have [401 error code documented for that endpoint](https://marketplace.zoom.us/docs/api-reference/zoom-api/methods/#operation/reportMeetingParticipants). Could you please share the details of the error and expand more upon the behavior?

There’s also [this guidance](https://support.zoom.us/hc/en-us/articles/5719763721101-Zoom-error-code-401) if you are seeing this consistently. Make sure you are logged into your developer account when you submit.

Thanks!

---

<div class="post-metadata">

**Author:** ![john.cunningham](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@john.cunningham](https://devforum.zoom.us/u/john.cunningham)\
**Post date:** [January 31, 2023, 9:20pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/4 "2023-01-31T21:20:13Z")

</div>

Apologies, I’m getting random 404 errors with Server-To-Server OAuth, not 401. Here is an example:

**Request:** [https://api.zoom.us/v2/report/meetings/AXcwSpw5RriOPiGS2h+UEA==/participants&next\_page\_token=2UvGMFbu3moA2S1KJzd5YBMruAofqbjqqW2](https://api.zoom.us/v2/report/meetings/AXcwSpw5RriOPiGS2h+UEA==/participants&next_page_token=2UvGMFbu3moA2S1KJzd5YBMruAofqbjqqW2)

**Response:**  
{StatusCode: 404, ReasonPhrase: ‘Not Found’, Version: 1.1, Content: System.Net.Http.HttpConnectionResponseContent, Headers:  
{  
Date: Tue, 31 Jan 2023 21:18:25 GMT  
Connection: keep-alive  
x-zm-trackingid: v=2.0;clid=us06;rid=WEB\_39af4638967abdefc9691620f717a4d1  
X-Content-Type-Options: nosniff  
Cache-Control: no-store, no-transform, must-revalidate, no-cache  
Pragma: no-cache  
Set-Cookie: zm\_aid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: zm\_haid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: zm\_tmaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: zm\_htmaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: cred=A633B77486B451EAB940F264E8891773; Path=/; Secure; HttpOnly  
Set-Cookie: \_zm\_ctaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: \_zm\_chtaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: \_zm\_ctaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Set-Cookie: \_zm\_chtaid=“”; [Domain=.zoom.us](http://Domain=.zoom.us); Expires=Thu, 01-Jan-1970 00:00:10 GMT; Path=/; Secure; HttpOnly  
Vary: Origin  
Vary: Access-Control-Request-Method  
Vary: Access-Control-Request-Headers  
x-ratelimit-category: Heavy  
x-ratelimit-limit: 60000  
x-ratelimit-remaining: 57777  
x-zm-zoneid: VA  
CF-Cache-Status: DYNAMIC  
Report-To: {“endpoints”:[{“url”:“https://a.nel.cloudflare.com/report/v3?s=mQLPK%2B1ARp1rkHylDAmXOX6SLEPrhkQ%2FPSCfcRNSwrozUfthagBifowH9N1EW%2BDaZ69YFFNnxfLDgGi75QI6085NakuWl%2BOBmKtavO6HDNK8k4tYskVO4s2hkIvZ”}],“group”:“cf-nel”,“max\_age”:604800}  
NEL: {“success\_fraction”:0.01,“report\_to”:“cf-nel”,“max\_age”:604800}  
Server: cloudflare  
CF-RAY: 79257acf0e03e770-EWR  
Content-Type: application/json; charset=UTF-8  
Content-Length: 140  
Expires: Thu, 01 Jan 1970 00:00:00 GMT  
}}

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [February 22, 2023, 6:29pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/5 "2023-02-22T18:29:07Z")

</div>

@john.cunningham , it’s happening occasionally with no change to how you’re calling the API endpoint? How often are you calling the endpoint?

---

<div class="post-metadata">

**Author:** ![john.cunningham](https://avatars.discourse-cdn.com/v4/letter/j/f08c70/32.png) [@john.cunningham](https://devforum.zoom.us/u/john.cunningham)\
**Post date:** [February 22, 2023, 7:00pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/6 "2023-02-22T19:00:21Z")

</div>

Yes, my code for these endpoints is identical, but results are inconsistent using server-to-server OAuth. I’m calling the report/meetings/meeting.uuid/participants endpoint for every meeting that takes place at my company in a given day, Daily meeting list size is in the hundreds. Each time I run my program, I get a different total number of daily meeting participants using server-to-server OAuth. Results are consistent using JWT. This process needs to run on a daily basis.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [February 24, 2023, 6:44pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/7 "2023-02-24T18:44:36Z")

</div>

Hi @john.cunningham , can you please share your results via private message so I can further investigate? Thank you!

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [March 15, 2023, 6:12pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/8 "2023-03-15T18:12:13Z")

</div>

This is currently under escalation review. Sharing the ticket number here for other developer and Developer Advocates who may encounter someone experiencing the same behavior (ZSEE-85355).

---

<div class="post-metadata">

**Author:** ![june.lhl](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/june.lhl/32/47024_2.png) [@june.lhl](https://devforum.zoom.us/u/june.lhl)\
**Post date:** [March 30, 2023, 7:53pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/9 "2023-03-30T19:53:35Z")

</div>

@gianni.zoom Following this as I think this is related to the force migration from JWT to the server-to-server tokens. With server-to-server tokens both expiring after an hour and invaliding past tokens when requesting a new one this issue manifests frequently as a race condition. Two requests coming in to our service, asking for a token around the same time will invalidate the others token before it even has a chance to use it. Either let these tokens live indefinitely (not ideal) or; keep the one hour expiry but let accounts request them as needed without invalidating previous ones. Also of note, it’s not useful to have up to three “indexed” tokens here. Are we expected to coordinate between all our incoming requests who gets which indexed token? Global mutex between all our backend servers that may be trying to use these tokens?!?

---

<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:** [March 30, 2023, 9:36pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/10 "2023-03-30T21:36:28Z")

</div>

For [key rotation](https://devforum.zoom.us/t/refresh-token-workflow-for-multi-tenant-apps/79405/2), we use a shared database that acts as a synchronization primitive to decide on a race condition winner process that [renews the token for the inactive slot well in advance](https://devforum.zoom.us/t/randomly-receiving-invalid-access-token-for-server-to-server-oauth/74432/15), then swaps that slot into active use for everyone in the same environment. This means you need 2 slots per environment, so we ended up creating multiple duplicate applications so we could have 4 slots to allocate among 2 environments.

---

<div class="post-metadata">

**Author:** ![gianni.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/gianni.zoom/32/32523_2.png) [@gianni.zoom](https://devforum.zoom.us/u/gianni.zoom)\
**Post date:** [March 31, 2023, 11:25pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/11 "2023-03-31T23:25:09Z")

</div>

Hi @june.lhl @MultiplayerSession ,

Appreciate your input, but the developer here is experiencing this error occasionally with a valid token nowhere near expiration while sending one request at a time.

---

<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:** [April 3, 2024, 3:02pm UTC](https://devforum.zoom.us/t/issue-migrating-jwt-to-server-to-server-oauth/82340/12 "2024-04-03T15:02:03Z")

</div>

Closed on April 3, 2024, 3:02pm UTC

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