How can I use crypto-js library of Node.js in servicenow.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2018 10:37 AM
I would like to integrate the AWS Lex with servicenow. Lex requires signature to be created first and this can be created by Crypto-js library of Node.js.
How can I access the crypto-js function in servicenow.
I would like to use the below Node.js code in servicenow.
var crypto = require("crypto-js"); function getSignatureKey(Crypto, key, dateStamp, regionName, serviceName) { var kDate = Crypto.HmacSHA256(dateStamp, "AWS4" + key); var kRegion = Crypto.HmacSHA256(regionName, kDate); var kService = Crypto.HmacSHA256(serviceName, kRegion); var kSigning = Crypto.HmacSHA256("aws4_request", kService); return kSigning; }
Below is the URL which shows the Node.js code.
https://docs.aws.amazon.com/general/latest/gr/signature-v4-examples.html#signature-v4-examples-javascript
Thank you
Ravi Gupta
- Labels:
-
Integrations
-
Scripting and Coding

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2018 11:09 AM
It's a bit of a pain. You can do it. Josh Nerius has a video about making crypto-js work with webpack.

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2019 04:44 PM
Hi Ravi,
Did you manage to get this working. I laos want to use crypto to sign using rsa-sha1 algorithm. But getting too many errors when I try to use the script
Please mark this response as correct or helpful if it assisted you with your question.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-25-2019 09:27 AM
Hi Sanjiv,
I was not able to complete this task.
Regards,
Ravi Gupta