Updated on 2024-11-06 GMT+08:00

LwM2M/CoAP Authentication

Introduction

LwM2M/CoAP authentication supports both encrypted and non-encrypted access modes. Non-encrypted mode: Devices connect to IoTDA carrying the node ID through port 5683. Encrypted mode: Devices connect to IoTDA carrying node ID and secret through port 5684 by the DTLS/DTLS+ channel.

Authentication for Devices Using LwM2M over CoAP

Figure 1 LwM2M/CoAP access authentication process
  1. An application calls the API for creating a device to register a device. Alternatively, a user uses the IoTDA console to register a device.
  2. The platform allocates a secret to the device and returns timeout.
    • The secret can be defined during device registration. If no secret is defined, the platform allocates one.
    • If the device is not connected to the platform within the duration specified by timeout, the platform deletes the device registration information.
  3. During login, the device sends a connection authentication request carrying the node ID (such as the IMEI) and secret if it is a security device, or carrying the node ID if it is a non-security device.
  4. If the authentication is successful, the platform returns a success message, and the device is connected to the platform.