Azure / azure-iot-sdk-node

A Node.js SDK for connecting devices to Microsoft Azure IoT services
https://docs.microsoft.com/en-us/azure/iot-hub/
Other
262 stars 227 forks source link

Does the nodejs sdk support x.509 certificate authentication for it's ModuleClient? #1216

Closed akboba01 closed 6 months ago

akboba01 commented 7 months ago

When attempting to use the ModuleClient with x.509 authentication I get an error NotImplementedError: ModuleClient only supports SAS Token authentication.

  const moduleClient = ModuleClient.fromConnectionString(
    `HostName=${hubName};DeviceId=${deviceId};ModuleId=${moduleId};x509=true`,
    Mqtt
  );

However, the IoT Hub docs imply this is possible. Is there a different way of using the node sdk to do this?

olivakar commented 6 months ago

It will throw this error if the connection string does not contain a SharedAccessKey field because x509 authentication is not supported for modules.

vishnureddy17 commented 6 months ago

Seems resolved, closing issue. Feel free to re-open if needed.