Use the Cordova command line interface to install the AuthProxy plugin.
Prerequisites
- Set up the development environment.
- Create your Cordova project.
- Add your OS platforms.
- On Android these permissions are required:
-
- <uses-permission android:name="android.permission.INTERNET"
/>
- <uses-permission
android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
- <uses-permission
android:name="android.permission.ACCESS_NETWORK_STATE" />
- On iOS:
- The plugin depends on afariaSLL.a
- Requires the link flag of "-lstdc++," if not yet included.
Procedure
- Add the AuthProxy plugin by entering the following at the command prompt, or
terminal:
cordova plugin add kapsel-plugin-authproxy --searchpath
KAPSEL_HOME/plugins
Note KAPSEL_HOME=C:\SAP\MobileSDK3\KapselSDK.
- Edit the config.xml file and set the preference
SAPKapselHandleHttpRequests to
true.
<preference name="SAPKapselHandleHttpRequests"
value="true" />
- (Optional) To see a list of installed plugins in your Cordova project,
open a command prompt or terminal window, navigate to your Cordova
project folder, and enter:
cordova plugins
The Cordova command line interface returns a JSON array showing
installed plugins, for
example:
[ 'cordova-plugin-camera',
'cordova-plugin-device-motion',
'cordova-plugin-file' ]
This
example shows that the Cordova project has the Cordova core
Camera, Accelerator (device-motion), and File plugins
installed.
- Modify the files in the Cordova project's www
folder as appropriate for your project.
- Execute the following command to copy the files in the Cordova
project's www folder to the platform
directories:
cordova prepare android
cordova prepare ios
cordova prepare windows
- Use the Android IDE, Xcode, or Visual Studio to deploy and run the project.
- (Optional) For iOS, if the application uses Afaria mutual certificate
authentication, or if multiple applications on the devices need to share the
credentials, you must first build and deploy Client Hub to
the device, and then add the "clienthubEntitlements" and "$(CFBundleIdentifier)"
items to the shared keychain groups in the application's project settings in
Xcode.