Azure IOT Hub Rest API Unauthorized
<p>I am trying to use Azure Iot hub REST API to create device by following links</p>

<p><a href="https://docs.microsoft.com/zh-tw/rest/api/iothub/create-a-new-device-identity" rel="nofollow noreferrer">Create a new device identity</a></p>

<p><a href="https://docs.microsoft.com/en-us/azure/iot-hub/iot-hub-devguide-security#security-tokens" rel="nofollow noreferrer">Control access to IoT Hub</a></p>

<p>And my http data is like</p>

<pre><code>{
    "status":"connected",
    "authentication":{ "symmetricKey":{
                "primaryKey":"key in shared access policies",
                "secondaryKey":"key in shared access policies"}
             },
    "statusReason":"reason",
    "deviceId":"test123"
}
</code></pre>

<p>My header is like </p>

<pre><code> ["Content-Type": "application/json", "Authorization": "SharedAccessSignature sig=(key in shared access policies public key)=&amp;se=1481687791&amp;skn=iothubowner&amp;sr=(my iot hub name).azure-devices.net%2fdevices%2ftest123"]
</code></pre>

<p>But i get error 401 </p>

<pre><code>{"Message":"ErrorCode:IotHubUnauthorizedAccess;Unauthorized","ExceptionMessage":"Tracking ID:(tracking id )-TimeStamp:12/14/2016 03:15:17"}
</code></pre>

<p>Anyone know how to fixed it , or to track the exceptionMessage ?</p>