When our browser-based eID workflows are run in an HTML iframe, it is good to set up an event listener on the parent window, to get a JS-event notification when the login workflow is completed either with a success or an error.

See MDN Mozilla Developer Network – Window.postMessage()

The event.data contains an object as below, where command will always be set to ‘zignsec_postback’.

Setup Eventlistener

HTML and Javascript example:

Javascript Event Response: NOEVENT

%MINIFYHTML4f461e1541cb8c46292b4e7040a71b1a4%

Event Data Returned on Cancelled Login

Json example:

{
   "command":"zignsec_postback",
   "errorcode":"USER_CANCEL",
   "error":"Action cancelled",
   "token":"a54330cd-90dc-41f8-bcd5-22d87701d876"
}

Event Data Returned on Successful Login

Json example:

{
   "command":"zignsec_postback",
   "errorcode":"",
   "error":"",
   "token":"1decb781-37db-4477-92f8-223586dd4f0f"
}