A Connection Token is an object that contains the connection mapping information for a connected product, this includes:
IoT Connector.
Credentials (username and password).
Mapping Asset ID and Path.
In order to provide end-users with the simplest experience in managing connected Things, it is strongly recommended to use Connection Tokens which allow activating new Things by providing a simple code (e.g. QRCode scanning).
Connection tokens can be registered through a specific API which can be called by the manufacturer or the hardware supplier during the assembly process.
In the alternative, you can directly upload to the DPS a CSV file containing all the connection tokens, by using the Connection Tokens widget.
In the case where the IoT Connector is configured at the tenant level, for example, you are using a third-party connector and the data flow is cloud-2-cloud, connection-token is not necessary if the product has been registered at least with the asset-id. Note that in this way, to activate the product it is enough to know the serial number of it, if you need a higher level of security, it is suggested to use also the connection-token which generally is accessible only by the owner of the product (a code inside the box of the product).
A connection-token holds the information required by the product to open the communication channel to the cloud. Connection tokens are registered separately from the products because it is not always known in advance which gateway will be deployed in which product.
Moreover, by keeping this information disjointed, it is possible to increase the level of security. During the activation phase, the user will be asked for two codes, the serial number, which can be easily found (e.g. barcode printed on the back), and the connection token, which is distributed as a tag together with the product documentation and therefore not visible immediately.
In other cases where you do not need a certain level of security, the token may be the same as the serial number, in such a way, during the product activation only one code is requested.