# LwM2M security object instance ID

**URL:** <https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065>\
**Category:** Forum\
**Tags:** lwm2m-agent, cumulocity-edge\
**Created:** [March 24, 2025, 12:22pm UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065 "2025-03-24T12:22:50Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![erikas](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@erikas](https://community.cumulocity.com/u/erikas)\
**Post date:** [March 24, 2025, 12:22pm UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/1 "2025-03-24T12:22:50Z")

</div>

Hello, wanted to ask if cumulocity server is sending correct instance ID when bootstrap server option is disabled?

LwM2M documentation:

`while the Instance ID:1 of the Security Object ID:0 contains the credentials for the LwM2M Bootstrap-Server.`

If i disable bootstrap server option (which means i have credentials for LwM2M server, not bootstrap-server)

 ![image](https://europe1.discourse-cdn.com/flex005/uploads/cumulocity/original/3X/7/5/75d18a7d0eba3c3b7d8ae2baac2ad492a535fcda.png)

I am getting `instance ID 1`. Shouldn’t be instance ID 0? I am really confused here.

---

<div class="post-metadata">

**Author:** ![Ozge\_Akin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/ozge_akin/32/32174_2.png) [@Ozge\_Akin](https://community.cumulocity.com/u/Ozge_Akin)\
**Post date:** [March 24, 2025, 3:26pm UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/2 "2025-03-24T15:26:41Z")

</div>

Hi,

The mentioned line from the LwM2M documentation is an example.

In our integration the bootstrap server setting starts from the 0th instance and LwM2M server setting starts from the 1st instance. It is possible to add additional offset if required.

The instance ID of where the LWM2M server and security information is stored shouldn’t be an issue. The important part would be to not overwrite the instance where it contains the bootstrap server information on the device.

As described in LwM2M specification ([https://www.openmobilealliance.org/release/lightweightm2m/V1\_0-20170208-A/OMA-TS-LightweightM2M-V1\_0-20170208-A.pdf](https://www.openmobilealliance.org/release/lightweightm2m/V1_0-20170208-A/OMA-TS-LightweightM2M-V1_0-20170208-A.pdf)), the actual pairing of Security and Server objects is done by Short Server ID value.

From LwM2M specification:  
“Note that according to the LwM2M Server Account definition, a usual LwM2M Server Account is composed of a Security  
Object Instance and a Server Object Instance which are paired by sharing (respectively in Resource 10 and Resource 0 of that  
Objects) the same Short Server ID; a Short Server ID being unique in the LwM2M Client.“

---

<div class="post-metadata">

**Author:** ![erikas](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@erikas](https://community.cumulocity.com/u/erikas)\
**Post date:** [March 25, 2025, 10:04am UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/3 "2025-03-25T10:04:11Z")

</div>

Thank you for your reply, one more question occurred:

if security object and server object SSID should match, what happens if i change SSID for security object. Should i change for server object as well?

in security object .xml i see this line:

`This Resource MUST be set when the Bootstrap-Server Resource has a value of 'false'`

> <https://github.com/OpenMobileAlliance/lwm2m-registry/blob/prod/0.xml>

or should i report error if SSID being changed?

---

<div class="post-metadata">

**Author:** ![Ozge\_Akin](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/ozge_akin/32/32174_2.png) [@Ozge\_Akin](https://community.cumulocity.com/u/Ozge_Akin)\
**Post date:** [March 25, 2025, 12:17pm UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/4 "2025-03-25T12:17:11Z")

</div>

Yes, there should be a matching Short Server ID to link LWM2M Server object to its LWM2M Security object.

LWM2M integration in Cumulocity already takes care of this setting behind the scenes.  
In LWM2M Configuration / Servers written in bootstrap view, it is possible for you to change Short Server ID for the corresponding Server setting.  
When the device connects with bootstrap to the platform in the next time, Cumulocity’s LWM2M Service will take care of writing to the device for the both LWM2M Security (Object ID: 0) and LWM2M Server (Object ID: 1) objects accordingly.

---

<div class="post-metadata">

**Author:** ![erikas](https://avatars.discourse-cdn.com/v4/letter/e/6de8d8/32.png) [@erikas](https://community.cumulocity.com/u/erikas)\
**Post date:** [March 26, 2025, 8:23am UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/5 "2025-03-26T08:23:56Z")

</div>

Thank you for your answers

---

<div class="post-metadata">

**Author:** ![system](https://dub1.discourse-cdn.com/flex005/user_avatar/community.cumulocity.com/system/32/31990_2.png) [@system](https://community.cumulocity.com/u/system)\
**Post date:** [March 27, 2025, 8:24am UTC](https://community.cumulocity.com/t/lwm2m-security-object-instance-id/12065/6 "2025-03-27T08:24:17Z")

</div>

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.
