# Cookies issue when performing auth

**URL:** <https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875>\
**Category:** Zoom Apps\
**Created:** [April 29, 2024, 12:36pm UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875 "2024-04-29T12:36:50Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![viral.webosmotic](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/viral.webosmotic/32/58933_2.png) [@viral.webosmotic](https://devforum.zoom.us/u/viral.webosmotic)\
**Post date:** [April 29, 2024, 12:36pm UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/1 "2024-04-29T12:36:50Z")

</div>

Hello devs, I am creating a Zoom application that basically renders an iframe. The issue I am having is, that when I perform auth to my server, my server sets 2 HttpOnly cookies, which is not getting set in some cases, sometimes cookies get set and everything goes well, but sometimes cookies are not setting set, which fails the auth to my server, what is the major issue with Zoom client browser and cookies and how to fix this issue?

---

<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:** [April 30, 2024, 6:53pm UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/2 "2024-04-30T18:53:41Z")

</div>

I’m sorry to hear that you’re having issues with cookies in your Zoom App. It sounds like the cache may be clearing periodically.

How often are you seeing that the cookies are not set? Is it at random or does it seem to be at an interval?

---

<div class="post-metadata">

**Author:** ![viral.webosmotic](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/viral.webosmotic/32/58933_2.png) [@viral.webosmotic](https://devforum.zoom.us/u/viral.webosmotic)\
**Post date:** [May 1, 2024, 10:56am UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/3 "2024-05-01T10:56:46Z")

</div>

Hey @MaxM , thanks for your reply, and answer to your question is random, by the way, I have found an alternative for that issue, but am having problem with getting the access token, I used callZoomAPI method from js zoom SDK, and in event handler, I received some code, redirect\_uri, state, timestamp, Now I send this data to my backend and call token API of Zoom, with clientID:clientSecret base 64 in Basic header, and code from event data, grant\_type as `authorization_code`, redirect\_uri receveied from event data and code\_challenge I used when calling callZoomAPI method. Still, I received data: { reason: ‘Invalid authorization code’, error: ‘invalid\_grant’ } This error, code is the one received from event data only! Really having a bad experience with Zoom SDK ! Hope for a quick reply! 🙂

---

<div class="post-metadata">

**Author:** ![00shafiqahmad](https://avatars.discourse-cdn.com/v4/letter/0/9fc348/32.png) [@00shafiqahmad](https://devforum.zoom.us/u/00shafiqahmad)\
**Post date:** [May 1, 2024, 11:45am UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/4 "2024-05-01T11:45:56Z")

</div>

Glad you found a workaround! It seems the **code** you’re sending to get the access token might be incorrect. Double-check it matches the one received in the event data exactly. Also, ensure **code\_challenge** matches the one used in **callZoomAPI.**

---

<div class="post-metadata">

**Author:** ![viral.webosmotic](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/viral.webosmotic/32/58933_2.png) [@viral.webosmotic](https://devforum.zoom.us/u/viral.webosmotic)\
**Post date:** [May 1, 2024, 11:50am UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/5 "2024-05-01T11:50:40Z")

</div>

Everything is correct, I have tried multiple times.

---

<div class="post-metadata">

**Author:** ![00shafiqahmad](https://avatars.discourse-cdn.com/v4/letter/0/9fc348/32.png) [@00shafiqahmad](https://devforum.zoom.us/u/00shafiqahmad)\
**Post date:** [May 1, 2024, 11:53am UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/6 "2024-05-01T11:53:39Z")

</div>

Understood. Since you’ve verified everything seems correct,

**Check Zoom API Documentation:**  
Double-check the Zoom API documentation for the **callZoomAPI** method and access token endpoint. Ensure you’re using the exact parameters and format required.

**Verify Backend Logic:**  
Review your backend code handling the data from the Zoom event. Look for any potential errors in processing or sending data (e.g., typos, incorrect encoding).

**Zoom Developer Support:**  
If the above doesn’t help, consider reaching out to Zoom Developer Support directly. They can provide more specific guidance based on your code and setup.

---

<div class="post-metadata">

**Author:** ![viral.webosmotic](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/viral.webosmotic/32/58933_2.png) [@viral.webosmotic](https://devforum.zoom.us/u/viral.webosmotic)\
**Post date:** [May 1, 2024, 1:02pm UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/7 "2024-05-01T13:02:01Z")

</div>

Hello, looks like I am having issue with codeChallenge, see what I am doing is,

1. I call ‘callZoomApi’ method, with a string something like ‘secretCode’ as codeChallenge. (Which I think is real issue.)
2. Now I get code, timestamp, redirect\_uri in onAuthrised event callback, now I send this to my backend and my backend call the Zoom API and I get that error.

So basically what this codeChallenge is, how to get its values ? And how the flow exactly is ? Can you please describe ? Like from what to do in frontend (react app) and what to do in backend (node) ?

---

<div class="post-metadata">

**Author:** ![viral.webosmotic](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/viral.webosmotic/32/58933_2.png) [@viral.webosmotic](https://devforum.zoom.us/u/viral.webosmotic)\
**Post date:** [May 1, 2024, 1:02pm UTC](https://devforum.zoom.us/t/cookies-issue-when-performing-auth/108875/8 "2024-05-01T13:02:22Z")

</div>

Same request to you too @MaxM ?
