Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DPS device client fails to provision group registration with invalid URI characters (e.g. colon) over HTTP #3061

Closed
drwill-ms opened this issue Jan 11, 2023 · 2 comments · Fixed by #3059
Assignees
Labels
bug Something isn't working. fix-checked-in Fix checked into main or preview, but not yet released. IoTSDK Tracks all IoT SDK issues across the board

Comments

@drwill-ms
Copy link
Contributor

drwill-ms commented Jan 11, 2023

When using the following sample azure-iot-sdk-csharp/provisioning/device/samples/how to guides/SymmetricKeySample at main · Azure/azure-iot-sdk-csharp · GitHub
The Primary key calculated via: azure-iot-sdk-csharp/provisioning/device/samples/getting started/ComputeDerivedSymmetricKeySample at main · Azure/azure-iot-sdk-csharp · GitHub

When trying to provision a device using a registration ID that contains the ":" character, it does not work and receive the following error:

"Microsoft.Azure.Devices.Provisioning.Client.ProvisioningTransportException: {"errorCode":401002,"trackingId":"xxx","message":"Unauthorized","timestampUtc":"2022-12-12T11:48:20.2787818Z"}
---> Microsoft.Rest.HttpOperationException: Operation returned an invalid status code 'Unauthorized'
at Microsoft.Azure.Devices.Provisioning.Client.Transport.RuntimeRegistration.RegisterDeviceWithHttpMessagesAsync(String registrationId, String idScope, DeviceRegistration deviceRegistration, Nullable`1 forceRegistration, Dictionary`2 customHeaders, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.RuntimeRegistrationExtensions.RegisterDeviceAsync(IRuntimeRegistration operations, String registrationId, String idScope, DeviceRegistration deviceRegistration, Nullable`1 forceRegistration, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Provisioning.Client.Transport.ProvisioningTransportHandlerHttp.RegisterAsync(ProvisioningTransportRegisterMessage message, CancellationToken cancellationToken)
--- End of inner exception stack trace ---
at Microsoft.Azure.Devices.Provisioning.Client.Transport.ProvisioningTransportHandlerHttp.RegisterAsync(ProvisioningTransportRegisterMessage message, CancellationToken cancellationToken)
at Microsoft.Azure.Devices.Provisioning.Client.Samples.ProvisioningDeviceClientSample.RunSampleAsync() in /azure-iot-sdk-csharp/provisioning/device/samples/how to guides/SymmetricKeySample/ProvisioningDeviceClientSample.cs:line 49"
@drwill-ms
Copy link
Contributor Author

Fixed in main and latest LTS branch. LTS release is pending and will be included in next (yet unscheduled) release from main.

@drwill-ms drwill-ms added the fix-checked-in Fix checked into main or preview, but not yet released. label Jan 12, 2023
@drwill-ms
Copy link
Contributor Author

Fixed bug in Microsoft.Azure.Devices.Provisioning.Http NuGet with patched LTS version 1.12.5 of the provisioning transport/HTTP NuGet.

Other relevant, corresponding LTS patch release NuGet versions include:

  • Microsoft.Azure.Devices.Client 1.36.7
  • Microsoft.Azure.Devices.Shared 1.27.2
  • Microsoft.Azure.Devices.Provisoning.Client 1.16.5

See patch notes for more details.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working. fix-checked-in Fix checked into main or preview, but not yet released. IoTSDK Tracks all IoT SDK issues across the board
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant