You can locally build an SAP Fiori Client plugin to work with Android SAP Authenticator by installing Apache Cordova. After this implementation, your users will be able to log on to SAP Fiori Client through single sign-on (SSO). For more information about the SSO configuration, see Setting Mobile Single Sign-On.
For this process, SAP Authenticator should use the URL for an identity provider (IdP) initiated SSO, starting with sapfioriclient:// scheme and containing j_username=[username]&j_passcode=[passcode] parameters, in order to launch a SAP Fiori Client build as described in this blog. The IdP should use TOTPLoginModule for authentication. For more information about the login module settings, see Configuring the Login Modules.
NOTE If you already have SAP Fiori Client on your system, skip the first two sections and go to Running SAP Fiori Client with Android SAP Authenticator section. |
Note: A user adds the application as favorite by activating mobile SSO and scanning a QR code.
To fulfill these prerequisites, you should proceed as follows:
Install SAP Mobile Platform SDK.
For more information about this installation, see Installation: SAP Mobile Platform SDK for Windows.
Download and extract a binary Apache Ant distribution.
For more information, see Prerequisites at Setting Up the Development Environment.
Install Java JDK.
For more information, see Setting Up the Development Environment.
Install Android SDK.
For more information, see Setting Up the Development Environment.
Make sure that in the Android SDK Manager you have installed the required packages listed in SDK Manager. In addition, if you are using a proxy server, configure HTTP proxy and port.
If you are using Eclipse, download and install the plugins.
For more information, see Setting Up the Development Environment.
Install Git.
For more information, see Installing Git at Setting Up the Development Environment.
Install Node.js v0.10.* and its package manager, npm, because it is necessary for the installation of Apache Cordova.
For more information, see Node.js.
CAUTION We recommend you install v0.10.25 node version because the latest version, v0.12.0, has incompatibility problems and may produce an error like the following: |
CAUTION If you are using a proxy server, you must configure npm. For more information, see Setting Up the Development Environment. |
Install Apache Cordova with the following command.
npm install -g cordova@<version>
CAUTION You have to install the Apache Cordova version according to the description in Installing Apache Cordova with Node.js. You can check the available Apache Cordova version on your Windows OS with the following info command: npm info cordova. |
Restart the command prompt and verify the Apache Cordova installation by entering the following command.
cordova -v
{
"packageName": "com.sap.fiori.client",
"targetFolder": "FioriClient",
"appName": "FioriClient",
"platforms": ["android"],
"crosswalkLocation" : "C:\\Crosswalk\\crosswalk cordova-10.39.235.15-arm\\bin"
}
Note: In the above example I use version 10.39.235.15 of Crosswalk Cordova. If you have installed another version, set the path with your correct bin directory location.
As of SMP SDK 3.0 SP06, the Fiori Client on Android should use Crosswalk to render HTML pages rather than the Android WebView for improved performance. When Crosswalk is used, the platform must be Android only as plugman is used rather than the Cordova command-line interface (CLI) which can build cross-platform projects. For more information about the Crasswalk installation, see Cordova with Crosswalk. You install plugman with the npm install -g plugman command. For more information, see Installing Plugman.
Go to folder C:\SAP\MobileSDK3\KapselSDK\apps\fiori_client and run the following commands:
npm install
node create_fiori_client.js
The create_fiori_client.js script creates the project.
The Android SAP Authenticator is a mobile application installed on Android mobile devices. This application is used to generate passcodes for one-time password authentication. For more information, see SAP Authenticator Mobile Application.
You need to add a specific plugin to your SAP Fiori Client project in order to handle the sapfioriclient URL scheme. You can use the following Apache Cordova plugin: http://plugins.telerik.com/plugin/custom-url-scheme.You can install the plugin according to the following conditions:
plugman install --platform android --project . --plugin https://github.com/Telerik-Verified-Plugins/Custom-URL-scheme --variable URL_SCHEME=sapfioriclient
cordova plugin add https://github.com/Telerik-Verified-Plugins/Custom-URL-scheme --variable URL_SCHEME=sapfioriclient
As a result, a new folder with the plugin is created, which contains LaunchMyApp.js.
function handleOpenURL(url) { // wrapping in a little timeout, so it doesn't interfere with other apps’ setup setTimeout(function() { customScheme = "sapfioriclient"; sap.FioriClient.MobileSSO = url.replace(customScheme + "://", "https://"); }, 300); }; |
The code to be added is marked in green.
... var goToFioriURL = function(errorCallback) { sap.FioriClient.getFioriURL(function (retrievedFioriURL) { if (!context.smpRegContext){ // If sap.FioriClient.context.smpRegContext is null, // don't allow the user to skip // the logon plugin by changing the URL. // sap.FioriClient.context.smpRegContext will be set //once logon is successful. // Once logon completes and the app navigates to the URL, //sap.FioriClient.context.smpRegContext will // be undefined, so it will pass this test. return; } if (!isUrl(retrievedFioriURL)) { errorCallback(); return; } if (!sap.FioriClient.MobileSSO) { setFioriURL(retrievedFioriURL); } // Add extra query string to force page reload. var buster = "smphomebuster=" + Math.random()*10000000000000000; ... var getFioriURL = function(callback) { function getFioriURLFromAppPreferencesFailed(error) { sap.Logger.info(error, 'FIORI_CLIENT'); // The Fiori URL wasn't found, so use the hardcoded value. doHttpsConversionIfNeeded(context.appConfig.fioriURL, callback); } function getFioriURLFromAppPreferencesSuccess(url) { if (sap.FioriClient.MobileSSO) { url = sap.FioriClient.MobileSSO; } if (url != null) { doHttpsConversionIfNeeded(url, callback); } else { doHttpsConversionIfNeeded(context.appConfig.fioriURL, callback); } } sap.AppPreferences.getPreferenceValue('fioriURL', getFioriURLFromAppPreferencesSuccess, getFioriURLFromAppPreferencesFailed); }; ... |
For more information, see step 4 in Creating SAP Fiori Client with Apache Cordova section.
SAP Fiori Client should be ready to handle any mobile SSO requests from SAP Authenticator. That means when a user adds SAP Fiori Client account and application in SAP Authenticator, the user will be able to log on to the SAP Fiori Client through mobile SSO.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
41 | |
25 | |
17 | |
14 | |
9 | |
7 | |
6 | |
6 | |
6 | |
6 |