Reputation: 7
i want use azure Device Identities REST API to create devices identity :https://msdn.microsoft.com/en-us/library/azure/mt548489.aspx but i don't know the syntaxe to set in header request ? what is the key and how to generate value ? here is the param :
Thanks
Upvotes: 0
Views: 361
Reputation: 24138
As @DominicBetts said, you can refer to the referenced document to generate the SAS token by yourself.
As reference, there is not an existing sample code for Java, but I think you can try to refer to the offical sample for Python to knwo how to use the device identities REST API, please see the sample at https://azure.microsoft.com/en-us/documentation/samples/iot-hub-python-get-started/ and download the sample zip file to see the script service/deviceManager.py
.
Meanwhile, you can also try to directly read the source code of IoTHub SDK for Java. For generating the SAS token, please see the code at https://github.com/Azure/azure-iot-sdks/blob/master/java/service/iothub-service-sdk/src/main/java/com/microsoft/azure/iot/service/auth/IotHubServiceSasToken.java.
Upvotes: 1
Reputation: 2331
Please take a look here: https://azure.microsoft.com/documentation/articles/iot-hub-sas-tokens/#using-security-tokens-from-service-components
This article explains how you can generate the security token you need - in particular the section "Using security tokens from service components".
Upvotes: 0