# Demo keeps refreshing at auth page

**URL:** <https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693>\
**Category:** Electron\
**Created:** [July 21, 2020, 4:31am UTC](https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693 "2020-07-21T04:31:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![peterlzhou](https://avatars.discourse-cdn.com/v4/letter/p/e95f7d/32.png) [@peterlzhou](https://devforum.zoom.us/u/peterlzhou)\
**Post date:** [July 21, 2020, 4:31am UTC](https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693/1 "2020-07-21T04:31:57Z")

</div>

**Description**  
I’m trying to get the demo to go to the login screen, but when I’m on the auth screen and enter the token, the page keeps refreshing. I am following the correct JWT generation instructions from [Jwt error 5 returned from AuthWithJwtToken](https://devforum.zoom.us/t/jwt-error-5-returned-from-authwithjwttoken/12692) and my AuthWithJWTToken is returning 0 as expected (although I’m not sure where to get the access token issue and expiration timestamps, so I have put down arbitrary timestamps), but the demo app keeps refreshing to the auth screen every time I hit “SDKAuth”

Here’s what my payload looks like:  
{  
“appKey”: “sdkkeyhere”,  
“iat”: 1595304469,  
“exp”: 1595364469,  
“tokenExp”: 1595364469  
}

I’ve logged the status inside of the function sdkauthCB and it’s returning 5, which is unknown. Is there something I’m doing wrong?

**Which version?**  
v5.0.24433.0616

**To Reproduce(If applicable)**  
Steps to reproduce the behavior:

1. “npm install” inside the demo directory
2. “sh build\_nodeaddon\_mac.sh” to rebuild the Zoom SDK
3. “sh run\_demo\_mac.sh” to start the demo
4. Hit “Start Demo”
5. Paste in the JWT from [jwt.io](http://jwt.io)
6. Hit “SDKAuth”
7. Observe the app refreshing

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 24, 2020, 5:32am UTC](https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693/2 "2020-07-24T05:32:13Z")

</div>

Hi @peterlzhou,

Thanks for using Zoom SDK. The error code 5 means the JWT token has some issues. Based on the JWT token provided, it seems like the timestamps for 3 fields are the same. The `exp` must be larger than `iat`, otherwise it will expire when the token is issued. The tokenExp field need to be a timestamp of at least `iat` + 30 minutes. You may find more information here: [https://github.com/zoom/zoom-sdk-electron/blob/master/CHANGELOG.md#new-sdk-initialization-method-using-jwt-token](https://github.com/zoom/zoom-sdk-electron/blob/master/CHANGELOG.md#new-sdk-initialization-method-using-jwt-token)

Thanks!

---

<div class="post-metadata">

**Author:** ![navin.prakash](https://avatars.discourse-cdn.com/v4/letter/n/7ba0ec/32.png) [@navin.prakash](https://devforum.zoom.us/u/navin.prakash)\
**Post date:** [July 25, 2020, 7:38am UTC](https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693/3 "2020-07-25T07:38:33Z")

</div>

It will help you. you can generate JWT token by following this method  
[https://devforum.zoom.us/t/electron-sdk-error-in-function-sdkauthcb-status-5/24816/4](https://devforum.zoom.us/t/electron-sdk-error-in-function-sdkauthcb-status-5/24816/4)

---

<div class="post-metadata">

**Author:** ![carson.zoom](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/carson.zoom/32/785_2.png) [@carson.zoom](https://devforum.zoom.us/u/carson.zoom)\
**Post date:** [July 29, 2020, 7:28am UTC](https://devforum.zoom.us/t/demo-keeps-refreshing-at-auth-page/24693/4 "2020-07-29T07:28:26Z")

</div>

@navin.prakash Thanks for sharing this.
