Kony Fabric console User Guide: SDKs > Kony Visualizer SDK > Usage of Custom App Security Key

HTTP Message Body Integrity

The Client App Security feature helps to secure data exchanged between a client app and a server app. Enterprise class applications may need to ensure that network traffic being exchanged between the server and client app is not tampered with. This feature detects and reports network traffic tampering on the data exchanged between the server and client app.

Best Practices - HTTP Message Body Integrity

As a security best practice, it is recommended that you have different Kony Fabric applications with different security keys for Native and Web.

Error Message - HTTP Message Body Integrity

While exchanging data between a client app and a server app and if the data is tampered, the following error message appears:

Limitations - HTTP Message Body Integrity

Note: You can enable HTTP Message Body Integrity by using Kony Fabric > Identity > SERVICE CONFIGURATION.

Usage of Custom App Security Key

Custom App Security Key that is configured in Kony Fabric must be provided to the SDK prior to initializing the SDK using a preshow action.

Syntax

setAppSecurityKey(customSecurityKey)

Parameters

Input Parameter Type Description Required
customSecurityKey String Custom security key defined in Kony Fabric by the user. It contains alphanumeric characters. Yes

Return Type

Type Value
Boolean True
JSON JSON object with keys, errmsg and errcode.

Sample Code

// Note: This piece of code must be called from preAppInit (i.e before SDK init)
// Get an instance of SDK
var client = kony.sdk.getCurrentInstance();
var response = client.setAppSecurityKey("customSecurityKey");
if (response !== null && response === true) {
    kony.print("Custom security key is set successfully");
} else {
    kony.print(response.errmsg + " and " + response.errcode);
}

Error Codes

Error Code Error Message
1023 Security Key must be a non empty string.

 

Note:
Copyright © 2019 Kony, Inc. All rights reserved.