Azure / iot-identity-service

Source of the Azure IoT Identity Service and related services.
MIT License
37 stars 46 forks source link

Add Key Endpoint for an IotAgent to use x.509 authentication #505

Closed agreentree-dmc closed 1 year ago

agreentree-dmc commented 1 year ago

I am using the Azure IoT Hub SDK for Python to establish a device connection to IoT Hub. The device authentication method is self-signed x509 certificates. I am using Azure Identity Service to manage and rotate device identity certificates with DPS enrollment and an EST Server.

I am looking for a way to utilize Azure Identity Service APIs to provide x509 credentials for use with the IoTHubDeviceClient class from the IoT Hub SDK for Python. Specifically to seed the information for it's create_from_x509_certificate method.

It is possible to access the certificate and key from the file system, but I am hoping for a more graceful implementation that allows my device client to leverage the APIs exposed by AIS to authenticate it's connection with IoT Hub while still using 509 certificates.

Could an endpoint be added to retrieve the Key for use in the IoTHubDeviceClient's create_from_x509_certificate method?

arsing commented 1 year ago

I don't know what the Python SDK does, but all the API needed for connecting to IoT Hub with a device identity is already there so there's nothing for us to add. You can look at what the C SDK does, for example, and then figure out how to make the Python SDK do the same thing.