I tried to get started with zoom desktop SDK and I got SDKERR_INTELNAL_ERROR response every time when I called m_AuthSDKWorkFlow.Auth(param).
I tried c++ and c# versions - result the same.
What is wrong?
Version
v5.0.24433.0616
zoom-sdk-windows-master\demo\sdk_demo_v2\sdk_demo_v2_2017.sln
To Reproduce
1 On the first form press button “SetDomain”. “https://zoom.us” in the field
2 On the second form enter JWT Token in the field and press “Auth”
I got error “auth sdk failed”. In the debugged I can see it is SDKError::SDKERR_INTELNAL_ERROR(15)
logs
Hi @svetlichny.dev,
Thanks for the post and pardon the late response. Based on the log provided, it seems like the JWT token is invalid. Could you provide a sample of your JWT payload?
You may also refer to the instruction here: https://github.com/zoom/zoom-sdk-windows/blob/master/CHANGELOG.md#new-sdk-initialization-method-using-jwt-token
Thanks!
Hi @carson.zoom,
Thanks for your answer. I tried to get new jwt token but result the same.
Also I tried using AuthParam instead of AuthContext. Result was negative. I got other error in the end.
ZOOM_SDK_NAMESPACE::AuthParam param;
param.appKey = myAppKey;
param.appSecret = myAppSecret;
My jwt payload
HEADER:ALGORITHM & TOKEN TYPE
{
“typ”: “JWT”,
“alg”: “HS256”
}
PAYLOAD:DATA
{
“aud”: null,
“iss”: “uogDBCKpQeiEQXUOZNkeUA”,
“exp”: 1602244849,
“iat”: 1601640050
}
Thanks
Hi @svetlichny.dev,
Thanks for reply and pardon the late response. The JWT payload that the SDK is expecting is(As shown in https://github.com/zoom/zoom-sdk-windows/blob/master/CHANGELOG.md#new-sdk-initialization-method-using-jwt-token):
{
"appKey": "string", // Your SDK key
"iat": long, // access token issue timestamp
"exp": long, // access token expire timestamp, max: iat + 2 days
"tokenExp": long // token expire timestamp, MIN:30 minutes
}
Here is a code snippet that could be helpful in generating the JWT token:
iat = long(int(time.time()))
exp = long((datetime.datetime.today() + datetime.timedelta(days=2)).strftime("%s"))
tokenExp = long((datetime.datetime.today() + datetime.timedelta(hours=1)).strftime("%s"))
payload = {
'appKey': key,
'iat': iat,
'exp': exp,
'tokenExp': tokenExp
}
encoded = jwt.encode(payload, secret, algorithm='HS256')
Hope this helps. Thanks!
Thank you for help
Everything works great after correct token generation
Glad to be helpful. I will go ahead and close this thread. Please feel free to create another post if any other questions.