# Zoom SDK doesn't work with SSO inside Electron

**URL:** <https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso-inside-electron/77355>\
**Category:** Web\
**Tags:** oauth, meeting-sdk, web-meeting-sdk\
**Created:** [October 13, 2022, 1:25pm UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso-inside-electron/77355 "2022-10-13T13:25:21Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![felipe.armoni](https://avatars.discourse-cdn.com/v4/letter/f/a183cd/32.png) [@felipe.armoni](https://devforum.zoom.us/u/felipe.armoni)\
**Post date:** [October 13, 2022, 1:25pm UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso-inside-electron/77355/1 "2022-10-13T13:25:21Z")

</div>

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](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:

```javascript
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](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:

1. 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 with `window.loadURL`).
2. Make sure that the Zoom Meeting is only available through an SSO login using a SAML integration.
3. Build the Electron app and make sure that the React page is loaded locally.
4. Open the Electron app and try to login.
5. Notice that the login is stuck in this screen:  
 ![image](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/1/0/102141295ade18a38e8afcc5180adf5911b02942.png)

**Device:**

- Device: MacbookPRO
- OS: macOS 12.6
- Browser: Chrome/104.0.5112.114 Electron/20.1.4 Safari/537.36

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex016/uploads/zoomdeveloper/original/3X/6/1/614bdd549b610bbaa46ff934617683a02bdaa03c.png) [@system](https://devforum.zoom.us/u/system)\
**Post date:** [November 12, 2022, 11:25pm UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso-inside-electron/77355/2 "2022-11-12T23:25:31Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
