Skip to content

AuthPluginParent should work when embed is opened in an iframe #1373

@mofojed

Description

@mofojed

Description

Discovered while @jnumainville was testing deephaven-ipywidgets in DnD Jupyter. We were hoping to use the AuthPluginParent to provide the authentication details, but that only works when the window is opened in another tab, not in an iframe.

Providing a zip that contains an html file reproducing the issue when you are running Deephaven locally at localhost:10000

Steps to reproduce

  1. Open the attached iframe-auth-provider.html example
  2. Open the developer console

Expected results
2. Developer console should have a message received printed out, and the iframe should time out after 10s (since it tries to use the auth plugin provider

Actual results
2. AuthPluginParent doesn't get used, it's just trying to use the AuthPluginAnonymous.

Additional details and attachments

The error is because we are only checking window.opener, instead of also checking window.parent:

window.opener != null && getWindowAuthProvider() === 'parent',

We also need to make sure we send the message to window.parent as well in this case, instead of window.opener (which is null):

window.opener.postMessage(makeMessage(request, id), '*');

iframe-auth-provider.zip

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions