Facing issue in SDK Authentication failed


We are facing the issues so many times using ZoomSDK. Please assist as soon as possible. It’s Urgent we need integrate in App. 

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/

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

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);

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 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!