Hi,
We are having a problem using the Zoom Meeting SDK with SSO inside an Electron application.
When the user wants to join a meeting, a popup page is opened with a login that is handled by our authentication provider. If the authentication is successful, he is redirected to a Zoom page that contains the tk
value (https://zoom.us/saml/externalAuth/XXX/YYYY)
This page has a script that takes the tk
(from a hidden input element) and calls the following function: window.opener.postMessage to send the tk
back to the page that is running the Zoom Meeting SDK.
Here is the snippet of code that does that:
if (tk) {
window.opener.postMessage(
{
type: 'ssoLoginSuccess',
tk: tk,
mtkGuid: mtkGuid,
},
sdkOrigin
); // sub window
setCookie('_zm_sdk_origin', '');
} else {
window.opener.postMessage(
{
type: 'ssoLoginFail',
tk: '',
},
sdkOrigin
);
setCookie('_zm_sdk_origin', '');
}
The problem is happening with the sdkOrigin
variable. Its value comes from the _zm_sdk_origin
cookie that is set by Zoom and contains the address of the page in which the Meeting SDK is running.
In a regular web application, the Meeting SDK is running in a hosted page like and the _zm_sdk_origin
’s value is something like: https://my-wepage/zoom-meeting.
However, in an Electron application the Meeting SDK is running in a page that is inside the file system so the _zm_sdk_origin
’s value should be something like: file:///path-to-my-page.html#zoom, but its value is actually just: file:///, which causes the window.opener.postMessage
function to fail to send the tk
information back to the Meeting SDK, which leaves the application perpetually waiting for the authentication to complete.
My guess is that this is a bug in the regular expression that is used to set the _zm_sdk_origin
cookie value.
Can you help me with this?
Which Web Meeting SDK version?
2.6.0
To Reproduce
Steps to reproduce the behavior:
- Create a new Electron app which contains a React page that is loaded locally, using
window.loadFile
(you won’t be able to reproduce this withwindow.loadURL
). - Make sure that the Zoom Meeting is only available through an SSO login using a SAML integration.
- Build the Electron app and make sure that the React page is loaded locally.
- Open the Electron app and try to login.
- Notice that the login is stuck in this screen:
Device:
- Device: MacbookPRO
- OS: macOS 12.6
- Browser: Chrome/104.0.5112.114 Electron/20.1.4 Safari/537.36