Skip to main content

Configuration

Getting the Initial SDK Configuration

In order to initialize the SDK a configuration string must be obtained using the approov CLI as follows:

approov sdk -getConfigString

This will output a configuration string such as this:

#your-account#+kv3bSO3x11jB25QN7/IdP3INz7WTpg+ScXG3vyLOJU=

The provided string is the config parameter to initialize Approov as described in the Mobile App Quickstarts. The information consists of the account identifier and public key string that uniquely identifies your account.

Getting the Extended SDK Configuration

In some special circumstances Approov support configure your account so that a special configuration string needs to be used. For instance, this might be required if the configuration requires communication with Approov servers to be proxied using a different DNS address, rather than using the addresses embedded in the SDK itself. To facilitate this, an extended form of the SDK configuration must be used. This is a much longer configuration string that is actually a base64 encoded JSON Web Token (JWT).

An extended SDK configuration can be obtained using the approov CLI as follows:

approov sdk -getConfig extended.config

In this case the configuration is written to the file extended.config. Copy the contents of this file and use it for the Approov initialization.

Handling Multiple Accounts

You may have access to multiple Approov accounts. Each account will have a different user roles in your Approov CLI. Furthermore, each account will have a different initial configuration for the SDK. This configuration will embed a different account name and also a different public key, since each account is allocated a different public/private key-pair. This prevents a configuration for one Approov account being valid for another.

These different initial configurations will need to be carefully managed in your app development and build environments. Note that, the account name that is read from the configuration is always logged as part of the Approov SDK initialization, e.g. an example from Android logcat:

2019-05-23 16:41:43.139 32592-32592/com.criticalblue.demo I/Approov: test-account, com.criticalblue.demo, 2.0.4(1033), h4gubfCFzJu81j/U2BJsdg==