# Facing issue in SDK Authentication failed

**URL:** <https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624>\
**Category:** iOS\
**Created:** [August 23, 2018, 1:26pm UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624 "2018-08-23T13:26:39Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![venky\_samcom](https://avatars.discourse-cdn.com/v4/letter/v/a587f6/32.png) [@venky\_samcom](https://devforum.zoom.us/u/venky_samcom)\
**Post date:** [August 23, 2018, 1:26pm UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/1 "2018-08-23T13:26:39Z")

</div>

![](https://support.zoom.us/hc/user_images/lKOZ2zmfsALLaBeJH2rLAA.png)  
We are&nbsp;facing the issues so many times using ZoomSDK.&nbsp;Please assist as soon as possible. It’s Urgent we need integrate in App.&nbsp;

---

<div class="post-metadata">

**Author:** ![Brian\_Dutton](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/brian_dutton/32/3424_2.png) [@Brian\_Dutton](https://devforum.zoom.us/u/Brian_Dutton)\
**Post date:** [August 23, 2018, 3:11pm UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/2 "2018-08-23T15:11:44Z")

</div>

Error code 5 is meeting is at capacity. You can see all of the error codes here:

[https://developer.zoom.us/docs/ios/error-codes/](https://developer.zoom.us/docs/ios/error-codes/)

---

<div class="post-metadata">

**Author:** ![Chao\_Bai](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/chao_bai/32/60_2.png) [@Chao\_Bai](https://devforum.zoom.us/u/Chao_Bai)\
**Post date:** [August 24, 2018, 12:53am UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/3 "2018-08-24T00:53:19Z")

</div>

incorrect SDK key & secret would introduce error code 5, please make sure use the correct SDK key & secret. Refer to&nbsp;[https://developer.zoom.us/docs/ios/](https://developer.zoom.us/docs/ios/)

---

<div class="post-metadata">

**Author:** ![micepadapp](https://avatars.discourse-cdn.com/v4/letter/m/a87d85/32.png) [@micepadapp](https://devforum.zoom.us/u/micepadapp)\
**Post date:** [July 15, 2020, 2:12am UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/4 "2020-07-15T02:12:26Z")

</div>

Getting the same error code 5 with JWT on iOS, not sure what does this means

```
func authenticateSDK(token: String) {
let authService = MobileRTC.shared().getAuthService()
if let authService = authService {
  authService.delegate = self
  authService.jwtToken = token
  authService.sdkAuth()
}

```

}

but it works with client key and client secret

```
func authenticateSDK(token: String) {
let authService = MobileRTC.shared().getAuthService()
let clientKey = "some key"
let clientSecret = "some secret"
if let authService = authService {
  authService.delegate = self
  authService.clientKey = clientKey
  authService.clientSecret = clientSecret
  authService.sdkAuth()
}

```

}

this is how we generate JWT on Node.js

```
const now = new Date(Date.now());
// expires in 2 hours
const expiresIn = new Date(now).setHours(now.getHours() + 8);
const payload = {
  appKey: config.zoom.sdkKey,
  iat: now.getTime(),
  exp: expiresIn,
  tokenExp: now.getTime() + 3000,
};
const token = jwt.sign(payload, config.zoom.sdkSecret);
```

---

<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 18, 2020, 3:51am UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/5 "2020-07-18T03:51:28Z")

</div>

Hi @micepadapp,

Thanks for the reply and the code snippet. The codes are correct but there is an issue with the JWT token that is generated by JavaScript:

Per [Date.prototype.getTime() - JavaScript | MDN](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/getTime),

> JavaScript uses _milliseconds_ as the unit of measurement, whereas Unix Time is in _seconds._

The regular JWT token requires the timestamps in seconds, so if you pass the timestamp you got from Date.now().getTime(), the timestamp will be invalid(Something like 50 thousand years later). Please try to convert the timestamp in seconds.

Thanks!

---

<div class="post-metadata">

**Author:** ![DeveloperBot](https://sea2.discourse-cdn.com/flex016/user_avatar/devforum.zoom.us/developerbot/32/12632_2.png) [@DeveloperBot](https://devforum.zoom.us/u/DeveloperBot)\
**Post date:** [August 21, 2020, 10:45pm UTC](https://devforum.zoom.us/t/facing-issue-in-sdk-authentication-failed/1624/6 "2020-08-21T22:45:53Z")

</div>


