Whether deviceInfo::digitalId need to Base64 Encoded for not registered device(L1 Device)

In the mosip-device-service-specification document

it says Device not registered. In this case, the device info will be only base64urlencode(payload)

  • The deviceInfo object is sent as JSON Web Token (JWT).
  • For a device which is not registered, the deviceInfo will be unsigned.

image

[
  {
    "deviceInfo": "base64urlencode(header).base64urlencode(payload).base64urlencode(signature)"
    "error": {
      "errorCode": "100",
      "errorInfo": "Device not registered. In this case, the device info will be only base64urlencode(payload)"
    }
  }
]

when I tested the not registed DeviceInfo service ( base64 encoded) use thd CTK deployed in my own env。

It tested failed.

when I tested the not registed DeviceInfo service ( not base64 encoded) use thd CTK deployed in my own env。

It tested succeed.

I look into the source code of CTK UI

https://github.com/mosip/mosip-compliance-toolkit-ui

I found it only support not base64 encoded deviceinfo.

the code is in sbi-testcase-service.ts
image

image

image
image

which is right for the not registed DeviceInfo. Need Base64 Encoded or not???

image

1 Like

Hey @dragon_king

I will ask one of my CTK team member to look into this first thing tomorrow to guide you with the L1 device issue.

Best Regards,
Team MOSIP

Hi

Please note as per specs:

  1. L1 devices cannot be used without registration.
  2. For L0 devices which are not registered, the deviceInfo will be unsigned.
  3. For L0 devices which are not registered, deviceInfo.digitalId will be unsigned.
  4. An unsigned deviceInfo will be = base64urlencoded(payload) where payload is the JSON object
  5. An unsigned deviceInfo.digitalId will be = base64urlencoded(payload) where payload is the JSON object.

I will get below line corrected in code. Thanks for pointing it out.
digitalIdDecoded = JSON.parse(deviceInfoDecoded.digitalId);

2 Likes

how long can this code be corrected?

Which branch of CTK code are you using locally?

Code fix will be available in release-1.x.x branch after our next planned release. Meanwhile you can make changes locally so that you can proceed with local testing.

my ctk branch is 1.2.1

code will be updated in next planned release