You can integrate web application into Aurora by placing that application into IFrame. If needed, application can have access to current user context.
The module we'll use to provide the integration is found at:
It allows you to place an application into IFrame, provides link for this app in main menu, enables a separate tab for it in admin area and, depending on configuration, may add a tab for it to user account settings.
Installation and configuration
The module is installed according to the standard procedure described at Adding modules documentation page.
By default, the module operates in "No authentication" mode. In module configuration tab under admin area, you need to provide application name and URL:
For every user account, it's possible to disable or enable the use of the application:
Additionally, the application can have current user context passed into it by providing auth token, so the application can get access to user account credentials, be it Aurora ones or some custom credentials specified for particular user account:
Let's suppose the application requires login and password of current user. Those aren't passed into application directly, though; only authentication token is sent through. However, with the use of Aurora Web API, it's possible to retrieve user account credentials.
Assuming that External App URL was set to
http://mydomain.com/myapp/index.php, the application can obtain account details with the following code in that
$sAuthToken = ( isset($_REQUEST["aurora_auth_token"]) ? $_REQUEST["aurora_auth_token"] : "" );
$aPostData = array(
"Module" => "Core",
"Method" => "GetAuthenticatedAccount"
$rCurl = curl_init();
CURLOPT_URL => "http://mydomain.com/aurora/index.php?/Api/",
CURLOPT_CUSTOMREQUEST => "POST",
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => $aPostData,
CURLOPT_SSL_VERIFYPEER => false,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_HTTPHEADER => array("Authorization: Bearer " . $sAuthToken)
$mResult = curl_exec($rCurl);
$oResult = ($mResult !== false) ? json_decode($mResult) : null;
if ($oResult !== null && isset($oResult->Result) && isset($oResult->Result->Password))
echo "Password is available";
Credentials are available as:
echo "Password is NOT available";
Note that in the above code, it doesn't matter whether auth token is passed via GET or POST, it would work either way.
The code deals with account credentials of Aurora users. But what if the application you need to integrate uses its own login/password combinations for existing users? This case is supported as well, and you can configure the module so that login/password are either supplied by users themselves, or entered by administrator for each of the accounts.
This approach can be implemented with a minimal modification of the above code:
$aPostData = array(
"Module" => "IframeAppWebclient",
"Method" => "GetCredentials"
The above assumes that you're simply installing the module the way it is, performing its configuration and using it on your installation. There might be cases, however, when you need to create a modification (fork) of the module. For example, if you need to integrate two different web applications into the same Aurora installation, you cannot reuse the same module twice. Instead, you would need to create a copy of the module, set it up in a separate repository, and rename a few entries throughout the module files, the changes are listed below.
During the development (especially on its initial stage) you would probably wish to, rather then dealing with creating a fork repository, have a separate copy of the module residing under modules directory next to the original module. Upon creating such a clone, you would need to rebuild static files as explained here.
- Module directory
The module itself needs to be renamed from IframeAppWebclient into the custom name.
In this file, you'll need to alter the lines:
so that they reflect new module name and its download location.
To avoid conflict with other instances of this module or its forks, you need to rename namespace found here:
<div class="screen IframeApp" style="display: none;">
While technically CSS class name affects nothing, it's a good practice to have HTML container renamed according to your module name.
Enumerations found here are presented by two classes:
class EIframeAppAuthMode extends \AbstractEnumeration
class EIframeAppTokenMode extends \AbstractEnumeration
- Language files
While it's not required, you may wish to adjust text constants found in language files under i18n directory.