locked
How to create an Authorization SharedAccessSignature RRS feed

  • Question

  • Hi,

    I'm trying to access the Azure Notification Hub REST interface from postman. The application that I'm developing does not have access to any .NET framework so I must assemble the request the hard way. Neraly all samples assume you use a framwork, I base my SAS on JavaScript samples.

    I keep getting a 401 40103 Invalid authorization signature no matter how I change the SharedAccessSignature.

    I use System.Security.Cryptography.HMACSHA256 to produce the signature (compiled into a standalone program that will be invoked from the application for this purpose).

    Suppose Azure portal gives med this Connection string:

    Endpoint=sb://ns-myown-namespace.servicebus.windows.net/;SharedAccessKeyName=DefaultFullSharedAccessSignature;SharedAccessKey=<mykey>

    and i want to make a

    GET  https://ns-myown-namespace.servicebus.windows.net/MY_NotificationHub/installations/45455?api-version=2015-01

    Which of these pieces of information must be URL-encoded or converted to lowercase, in computing the signature and in the sr of the SAS, in order for ANH to accept the SAS as a match for the requested resource?

    Regards Ove

    Edit: I found this article with sample code for generating the SAS. Shows how the SAS properties relate to the resource to be accessed. See Program.cs under VSProject/GenerateSAS

    https://github.com/dx-ted-emea/azure-tessel/tree/master/labs/notification-hub

    • Edited by oveker Monday, May 15, 2017 5:55 AM
    Friday, May 12, 2017 2:37 PM