- Configuring the Onegini SDKs
Configuring the Onegini SDKs
The following steps describe how to configure our native Android and iOS SDKs for your platform.
When you add a platform to your Cordova project, the Onegini Cordova Plugin will automatically try to invoke the Onegini SDK Configurator.
The SDK Configurator then reads the Token Server Configuration from configuration zip files you can obtain from your Token Server admin panel.
Configuration settings not relevant to your Token Server will be read from your project's
Install the SDK Configurator
Download the latest 3.x release for your platform from the release page and extract the zip file. You will then need to point the Onegini Cordova Plugin to your Configurator executable.
The easiest way the Plugin can find your Configurator is by setting the
ONEGINI_SDK_CONFIGURATOR_PATH environment variable.
The Plugin will also try to find the configurator in your
ONEGINI_SDK_CONFIGURATOR_PATH is not set. If you set the Configurator in your
can also run the configurator from the command line.
Adding the Token Server configuration to your project
Download the configuration zips from your Token Server admin panel under
Configuration > Applications > My App. Under Platform versions click
Export Platform version config.
The easiest way the plugin can find your configuration files is to store them as
onegini-config-ios.zip in the root of your
You can specify alternative locations for these files by Customizing the configuration hook.
Setting application preferences
Apart from your Token Server Configuration, the Configurator will read some properties from your
config.xml file. Changes in these preferences are only
picked up after re-running the Configurator. The following preferences can be set:
|OneginiRootDetectionEnabled||true||Enable Root detection in your application. This disable your application on rooted Android devices.|
|OneginiDebugDetectionEnabled||true||Enable Debug detection. This will disable attempts to attach a debugger to your application on Android and iOS.|
|OneginiWebView||None||The webview used to handle registration. See also: user registration topic guide.|
Add these to your
config.xml file as follows:
<preference name="Preference" value="Value" />
For more information on Cordova Preferences refer to the Cordova Documentation.
Customizing the configuration hook
The configuration hook is used to invoke the Configurator. The hook can be customized by setting the following environment variables:
||true||Enable or disable the configuration hook, you will need to manually configure your platforms if disabled.|
||Location of the Onegini SDK Configurator executable.|
||Location of the Token Server configuration zip file for Android.|
||Location of the Token Server configuration zip file for iOS.|
For example, to change the location of the Android and iOS configuration zips you can set:
export ONEGINI_CONFIG_ANDROID_PATH=/path/to/android-config.zip export ONEGINI_CONFIG_IOS_PATH=/path/to/ios-config.zip
Customizing the resolve dependencies hook
This hook is only triggered for iOS platforms since the Android the SDK is downloaded and managed by Gradle which is automatically invoked when building your Android project.
The resolve dependencies hook can be customized using the following environment variables:
||The iOS SDK is quite big and if you want to prevent downloading it every time you can specify a different location that is not cleaned when you remove or add the plugin to your Cordova project. The hook will check whether the SDK is already downloaded before downloading it again.|
For example, to change the location of the SDK download path you can set: