[Bug Report][v2] [IoTSDK] Issue with getting the Provisioning device client with symmetric key sample to work.
tweickmans opened this issue · 1 comments
Hello
I implemented communication between a device and a IotHub.
I use previews/v2 SDK
Context
OS, version, SKU and CPU architecture used: Windows 10 Enterprise | Intel(R) Core(TM) i7
Application's .NET Target Framework : net6.0
Device: Laptop
SDK version used: v2-preview007
Description of the issue
In the public async Task RunSampleAsync() method of ProvisioningDeviceClientSample.cs, the following code is called:
Unfortunately, the AuthenticationProviderSymmetricKey constructor does not work. It generates an exception: 'argument couldn't be null' (for secondaryKey).
due to the constructor definition:
To resolve this, you probably need to either modify the constructor of AuthenticationProviderSymmetricKey to accept the secondaryKey parameter as null, or update the example code to use primaryKey and secondaryKey.
It's not very clear in my mind whether it's necessary to provide the secondaryKey.
In the v1 version of the SDK, it was possible to provide only the primaryKey to SecurityProviderSymmetricKey
The fix has been checked in, so I'll close this thread