Electron SDK Demo App Authorization Not Works. Error code 15

Description
Token authorization does not work in the demo app. It returns error code 15. Token works fine and tested with Zoom API.

Which version?
Latest.

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

  1. Run the demo app.
  2. Enter token.
  3. Click the SDKAuth button.
  4. See the error at the console output.

Screenshots
If applicable, add screenshots to help explain your problem.

Hi @alex.erygin,

Thanks for using Zoom SDK. We have followed the steps you provided but unfortunately we are not able to reproduce this error. May I ask how do you generate your JWT token? Could you provide the payload(Without the keys & secret)?

Thanks!

1 Like
  • I’ve solved that, and the JWT of the SDK must be implemented by you

@alex.erygin you need to get SDK Key and Secret for Desktop SDKs, then generate JWT token yourself with them.

Your JWT token works for Zoom API because it’s built from Zoom API Key and Secret and will not work for Desktop SDKs.

Hi @carson.zoom! Thank you for response.
My payload:
{
“iss”: “LusO7a1SjEHYeJ5eb2CXiMzLmNiLffmonUix”,
“exp”: “1594837372”
}

@desko27, can you provide payload example? I Use SDK Key and Secret, but it is still not work. I think problem is wrong payload.

Hi @alex.erygin,

Thanks for the reply. Yes, the JWT and the payload requires a specific format, here is an example:

  • Header
{
  "alg": "HS256",
  "typ": "JWT"
}
  • Payload
{
	  "appKey": "string", // Your SDK key
         "iat": long, // access token issue timestamp
         "exp": long, // access token expire timestamp
         "tokenExp": long // token expire timestamp, MIN:30 minutes
}
  • Signature
HMACSHA256(
  base64UrlEncode(header) + "." +
  base64UrlEncode(payload),
  "Your SDK secret here"
)

You may find the info in https://github.com/zoom/zoom-sdk-electron/blob/master/CHANGELOG.md.
Please have a try. Thanks!

Also, the jsonwebtoken npm package is really useful to handle JWT generation.

This is what works for me:

const jwt = require('jsonwebtoken')

const ZOOM_SDK_KEY = 'your zoom sdk key'
const ZOOM_SDK_SECRET = 'your zoom  sdk secret'

// make jwt token from sdk key and secret
const timestampIssued = Math.floor(Date.now() / 1000) - 60 // ms -> s
const timestampExpires = timestampIssued + 86400 // 24h
const token = jwt.sign(
  {
    appKey: ZOOM_SDK_KEY,
    iat: timestampIssued,
    exp: timestampExpires,
    tokenExp: timestampExpires
  },
  ZOOM_SDK_SECRET,
  {
    header: {
      alg: 'HS256',
      typ: 'JWT'
    }
  }
)
2 Likes

Thanks for sharing this! :smile: