Feature #12192
Embedded Mode: token auto-login, non-ADM windows and large menus
Status:
New
Priority:
Normal
Assignee:
-
Target version:
-
Start date:
Due date:
% Done:
0%
billable:
No
vendor_id:
GCD
case_num:
version_reported:
version_resolved:
reviewer:
production:
No
env_name:
topics:
History
#1 Updated by Greg Shah 7 days ago
Problem¶
Embedded mode runs the FWD web client inside an iframe of a host web application (Embedded Mode Developer Guide). The host page and the 4GL code talk through window.postMessage, p2j.embedded.invokeProcedure and P2J-REMOTE-CALL, and the embedded driver (fwd-embedded-driver.p) lists, runs, switches and closes the application's windows and exposes their menus and toolbars as JSON.
Currently:
- the session must be started through a login form; auto-login from an identity the host application already holds is not implemented;
- the driver is built around ADM windows: windows that are not ADM containers, and windows that take parameters, are not listed or managed;
- a modal dialog with its own
WAIT-FOR, run from a module, fails with a "module cannot be run" error; - some keys are captured by the browser (for example CTRL+F4) and never reach the application, and clicking a host toolbar button does not fire
LEAVEon the focused field; - the module tree is built in full at startup, which is too large for applications with thousands of menu entries.
Work¶
- Token auto-login. Allow
/embeddedto start a session from a token passed by the host page, with no login form, validated by the configuredSsoAuthenticator. The token is single-use with a short lifetime, and the authenticator maps it to the FWD account. Document the token contract for host applications. - Non-ADM windows. Extend the driver to manage plain top-level windows created by the 4GL code (
CREATE WINDOW, static windows run persistently or not): list, activate, switch, close and resize them, and expose their menubars. - Windows with parameters. Allow a module to be run with input parameters supplied by the 4GL module tree or the host page.
- Modal dialogs. Support a dialog with its own
WAIT-FORrun from a module, without the "module cannot be run" error, with the overlay over the host page. - Keys and focus. Provide an alternative for keys the browser captures, configurable per application, and fire
LEAVEon the focused widget before a host toolbar or menu action runs. - Large menus. Let the 4GL code supply the module tree lazily, one branch at a time, through a driver callback, instead of building it in full at startup.
- Sizing and lifecycle. Resize the active window to the iframe when the host tab is resized, and end the session cleanly when the host page logs out or closes, including the watchdog case.
- Update Embedded Mode Developer Guide.
Testcases¶
- Auto-login with a valid token, and with expired, reused and tampered tokens.
- Open, switch and close several windows, mixing ADM and plain windows; a window run with parameters.
- A module that opens a modal dialog with its own
WAIT-FOR, and nested dialogs. - Captured keys through the configured alternative;
LEAVEfired before a host toolbar action. - A menu tree of several thousand entries loaded lazily.
- Two embedded sessions in two host tabs; host logout ends the session; browser refresh within the watchdog period reconnects.