Description
onAuthenticationReturn returns AUTHRET_UNKNOWN: 5, // Auth Unknown error after
AuthWithJwtToken(jwt) which return AUTHRET_SUCCESS 0
const { ZoomSDK } = require('../../lib/zoom_sdk.js');
const jsonwebtoken = require('jsonwebtoken');
const payload = {
app_key: 'SDKKey',
version: 1,
iat: Math.round(new Date().getTime() / 1000),
exp: Math.round((new Date().getTime() + 1 * 24 * 60 * 60 * 1000) / 1000),
tokenExp: Math.round((new Date().getTime() + 1 * 12 * 60 * 60 * 1000) / 1000),
};
const jwt = jsonwebtoken.sign(payload, 'SDKSecret');
const initoptions: { [key: string]: any } = {
ostype: ZOOM_TYPE_OS_TYPE.MAC_OS,
threadsafemode: 0,
webdomain: 'https://www.zoom.us',
domain: 'https://www.zoom.us',
};
initoptions.path =
platform == 'darwin' ? '../../sdk/mac/' : arch == 'x64' ? '../../sdk/win64/' : '../../sdk/win32/';
if (platform == 'darwin' && nativeTheme) {
nativeTheme.themeSource = 'light';
}
const zoomsdk = ZoomSDK.getInstance(initoptions);
zoomsdk.InitSDK();
const zoomauth = zoomsdk.GetAuth({
authcb: sdkauthCB,
logincb: loginretCB,
logoutcb: null,
});
const jwtresult = zoomauth.AuthWithJwtToken(jwt); // 0
function sdkauthCB(status: any) {
console.log('sdk auth cb ', status); // sdk auth cb 5
console.log('get auth result ', zoomauth.GetAuthResult()); // get auth result 5
console.log('get login status ', zoomauth.GetLoginStatus()); // get login status 0
}
Example of generated jwt eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJhcHBfa2V5IjoiU0RLS2V5IiwidmVyc2lvbiI6MSwiaWF0IjoxNjA0NzM2NDE4LCJleHAiOjE2MDQ4MjI4MTgsInRva2VuRXhwIjoxNjA0Nzc5NjE4fQ.Dps2uYcnwu_YeTBFifaUr338vYeumQg4bj-XgyDtcNE - app_key changed to SDKKey
Which version?
“electron”: “10.1.5”,
- macOS 10.15
Additional context
I was trying to auth via SDKAuth, but nothing changes.
Also there are many messages in console like this
objc[82076]: Class ZPLogHelperNull is implemented in both __dirname/medcart_securevideo/node_modules/electron/dist/Electron.app/Contents/Frameworks/ZoomSDKChatUI.framework/Versions/A/ZoomSDKChatUI (0x11a1752e8) and __dirname/medcart_securevideo/node_modules/electron/dist/Electron.app/Contents/Frameworks/zChatApp.bundle/Contents/MacOS/zChatApp (0x11bb979f0). One of the two will be used. Which one is undefined.