Generate SAS Token to invoke Azure Notification Hub REST API

Piero Virgilio
Tera Expert

Hi all,

I'm implementing an integration with Azure to send push notification through Notification Hub to a custom mobile app from customer instance.

The authentication to the REST API is by Shared Access Secret Token with this format:

SharedAccessSignature sig=<signature-string>&se=<expiry>&skn=<keyName>&sr=<URL-encoded-resourceURI>

To generate the <signature-string> I have to compute using the HMAC-SHA256 the following string:

<resourceURI> + "\n" + expiry;

How can I use the hmac-sha256 algorithm in ServiceNow?
I've found this script include online but I'm not able to use the CryptoJS.HmacSHA256(message, key) method (row 887).

Has anyone ever used CryptoJS in ServiceNow?

Thanks,
Piero.

 
2 REPLIES 2

Pavetiran
Kilo Explorer

Hi,


Was anyone able to find an answer to this? As this is something that I am trying to do as well.

Cheers.

This may work: CertificateEncryption | ServiceNow Developers Though I have run into some limitations with it specifically with relation to AWS as AWS requires binary key output iirc.