# Zoom SDK doesn't work with SSO

**URL:** <https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso/113802>\
**Category:** Web\
**Created:** [July 17, 2024, 1:43am UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso/113802 "2024-07-17T01:43:02Z")\
**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:** [July 17, 2024, 1:43am UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso/113802/1 "2024-07-17T01:43:02Z")

</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 successfull, 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:

```js
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?

---

<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:** [August 16, 2024, 11:43am UTC](https://devforum.zoom.us/t/zoom-sdk-doesnt-work-with-sso/113802/2 "2024-08-16T11:43:39Z")

</div>

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