ThingWorx Edge MicroServer (EMS) > Authenticating and Binding
Authenticating and Binding
The appKey group of the configuration file is used for authentication. The EMS must be authenticated to connect to a ThingWorx Platform instance.
An application key is an authentication token that is generated by the ThingWorx Platform instance and that represents a specific user. The application key is sent along with the connection request to authenticate the EMS with the ThingWorx Platform instance, and apply the correct permissions that are associated with the application key’s user account.
* 
To encrypt your application key before copying it to the config.json file for your EMS, refer to Encrypting Application Keys, Passwords, and Passphrases.
The application key is set by a simple top-level key in the JSON structure.
"appKey": "some_encrypted_application_key",
* 
The code sample above is provided for example purposes only. Copy and paste the application key that you generated and encrypted into the value side of "appKey": "some_encrypted_application_key".
* 
Enabling authentication is an important component of a secure configuration. For examples of secure configurations for communications between the EMS and the LSR, refer to Examples of Configuring Secure Communications between the EMS and an LSR . These examples are presented in order of least secure (testing purposes ONLY) to most secure (strongly recommended for production environments).
Binding
Once another device registers with the EMS (by sending an auto bind message), the EMS sends a BIND message to the ThingWorx Platform instance on behalf of that device. The ThingWorx Platform instance then associates the WebSocket on which EMS is communicating with a Remote Thing on the platform instance whose name or identifier matches the name or identifier sent by the EMS (the Remote Thing must have been created on the platform instance, using the RemoteThing Thing Template or one of its derivative templates). This association is the binding that must exist so that the platform instance can send requests to the device that is communicating through the EMS. For information about automatic binding and the EMS, refer to the section, Configuring Automatic Binding for EMS. For information about configuring the gateway option for automatic binding, refer to Auto-bound Gateways.
Was this helpful?