Unable to join meeting: Sdk key length error, must 36

I was told at one of my earlier post that the web SDK version 2.6 which I’ve been using will stop working on 5th August, and I’ll need to upgrade to at least version 2.7 with authentication with using Meeting SDK App Type.

I just did it, it does not work somehow, I assume others may run into the same problem, hence let me open a new post with what I did explain in detail, so that it can be helpful to others as well.

What I did:

  1. Created a Meeting SDK type app, and obtained both Client ID and Client Secret. (in the migration doc, it talks about SDK key, which is same as Client ID)

  2. Updated the signing logic on my server. (I have a Java Springboot backend, I updated it base on the JavaScript implementation that I found in this post thanks to Chun Siong, the output looks something like: eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.ey..., 285 characters in total length.)

  3. Upgraded web sdk version to 2.7, and updated the payload passed in to ZoomMtg.join (replaced apiKey with sdkKey).

Then I tried it out, it didn’t work, with error Api key length error, must 22/36, and the client ID that comes with my meeting SDK app was only 21 characters in length, I googled a bit, and found this post, in which another dev says you’ll get a 22 characters client ID if you create another meeting SDK app. What?! Well, I tried, guess what, the second meeting SDK app does come with a 22 characters client ID. :joy:

So I tried again, still no luck, the error message now becomes Sdk key length error, must 36, some progress at least. The new error message led me counting the characters length of client secret, well, it has only 32 characters…I tried to re-generate it, no luck.

Where can I get this correct client secret? Try create the 3rd meeting SDK app? :joy:

public String signV2(String meetingNumber, Integer role) {
	try {
	    long iat = (System.currentTimeMillis() - 30000) / 1000;
	    long exp = iat + 60 * 60 * 2;

	    Key key = Keys.hmacShaKeyFor(apiSecret.getBytes());

	    Header<?> header = Jwts.header().setType("JWT");

	    String jws = Jwts.builder()
	            .setHeader((Map<String, Object>) header)
	            .claim("sdkKey", apiKey)
	            .claim("mn", meetingNumber)
	            .claim("role", role)
	            .claim("iat", iat)
	            .claim("exp", exp)
	            .claim("appKey", apiKey)
	            .claim("tokenExp", exp)
	            .signWith(key, SignatureAlgorithm.HS256)
	            .compact();

	    return jws;
	} catch (Exception e) {
	    // ignore
        }
}

web sdk version to 2.7 does’t support client ID/client Secret, you have to upgrade to 2.10.1 (or newer)

2 Likes

Ah, that’s why, thanks Jürgen!