Signature related errors when upgrading zoom meeting SDK to 2.12.0

Hi team,

We are upgrading meeting SDK to.12.0

We followed zoom provided documentation(https://developers.zoom.us/docs/meeting-sdk/auth/#generate-the-sdk-jwt) for signature genration process.

Below are the sample payload details for signature genration:

headers:
{
“typ”: “JWT”,
“alg”: “HS256”
}

claims:
{
“tokenExp”: 1685099172,
“mn”: “88647018174”,
“role”: 1,
“sdkKey”: “uCVOcGqnTp3e1RWUG9IXCrhU5cZjQkS1oXE2”,
“appKey”: “uCVOcGqnTp3e1RWUG9IXCrhU5cZjQkS1oXE2”,
“exp”: 1685099172,
“iat”: 1685095572
}

Below is the signature that was generated for above payload:
eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ0b2tlbkV4cCI6MTY4NTA5OTE3MiwibW4iOiI4ODY0NzAxODE3NCIsInJvbGUiOjEsInNka0tleSI6InVDVk9jR3FuVHAzZTFSV1VHOUlYQ3JoVTVjWmpRa1Mxb1hFMiIsImFwcEtleSI6InVDVk9jR3FuVHAzZTFSV1VHOUlYQ3JoVTVjWmpRa1Mxb1hFMiIsImV4cCI6MTY4NTA5OTE3MiwiaWF0IjoxNjg1MDk1NTcyfQ.qRszNxeTNy5aq9lpt0HZLaaZuCI_TGfq7Z3cAnSvp0s

Below is the java code snippet for signature genration:

public String generateZoomMeetingSDKJWT(String meetingNumber, int role) {

    long currentTimestamp = LocalDateTime.now().toInstant(ZoneOffset.UTC).getEpochSecond();
    long jwtExpireTime = currentTimestamp + 3600;

    Map<String, Object> headers = new HashMap<>();
    headers.put("alg", "HS256");
    headers.put("typ", "JWT");

    Map<String, Object> claims = new HashMap<>();
    claims.put("appKey", ZOOM_SDK_KEY);
    claims.put("sdkKey", ZOOM_SDK_KEY);
    claims.put("mn", meetingNumber);
    claims.put("role", role);
    claims.put("iat", currentTimestamp);
    claims.put("exp", jwtExpireTime);
    claims.put("tokenExp", jwtExpireTime);

    String jwt = Jwts.builder()
        .setHeader(headers)
        .setClaims(claims)
        .signWith(SignatureAlgorithm.HS256, ZOOM_SDK_SECRET)
        .compact();

    return jwt;
}

scenario-1:

we are getting “signature is invalid” error when iat, exp and tokenExp are provided in seconds. Attached is the screenshot for the same.

scenario-2:

we are getting “signature is expired” erro when iat, exp and tokenExp are provided in milliseconds. Attached is the screenshot for the same.

Could you please look into these issues and provide your inputs.

Please let me know if you need any more information.


seconds are correct, milliseconds are for the deprecated JWT app

we are getting “signature is invalid” error

error 3712 ? This error message can mean “signature not yet valid”

zoom server checks the start time (iat) and end time (exp) of the signature

try change the iat from “currentTime” to “currentTime - 30 seconds

Thanks for your reply @j.schoenemeyer ,

yes, we are getting “signature is invalid” error with 3712 error code.

I tried with your input by changing “iat” from “currentTime” to “currentTime - 30 seconds ” but ended up with error(3712)

Hi team,

Any inputs will be highly appreciated.

Thanks,
Devendra

here are some infos for troubleshooting the signature

additional info: If you want to enter the meeting as “host” (role = 1) but it is not allowed

you will also get the error message

  • “Joining meeting timeout. Signature is invalid. (3712)”

try connect as “attendee” (role = 0)