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
- Open the attached iframe-auth-provider.html example
- 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
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
Expected results
2. Developer console should have a
message receivedprinted out, and the iframe should time out after 10s (since it tries to use the auth plugin providerActual 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 checkingwindow.parent:web-client-ui/packages/auth-plugins/src/AuthPluginParent.tsx
Line 52 in 626de83
We also need to make sure we send the message to
window.parentas well in this case, instead ofwindow.opener(which is null):web-client-ui/packages/jsapi-utils/src/MessageUtils.ts
Line 134 in 626de83
iframe-auth-provider.zip