- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-08-2022 07:20 AM
Hello,
I've tried to implement some variant of CryptoJS for making an authentication token. The problem is when i run the code snippet below I encounter this error:
Evaluator.evaluateString() problem: java.lang.SecurityException: Encountered scriptable of unknown type Object
var key = "sample_key";
var secret = CryptoJS.enc.Base64.parse(key);
var str = CryptoJS.HmacSHA512("sample_data", secret);
str = CryptoJS.enc.Base64.stringify(str);
I think the error is occuring when trying to create the HmacSHA512 encoding. The code works fine running in a node.js environment.
I have created a Script Include called CryptoJS with the code attached in the file.
Anyone have some experience working with HmacSHA512, any help is appriciated.
Solved! Go to Solution.
- Labels:
-
Workflow
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 01:11 AM
Not sure why that is. However I'll attach your file modified by me as described; I've tested it in both San Diego and Quebec. I assume if it works in those two, it should also work in Rome.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-11-2022 08:25 AM
There is actually an out of box method for that, it's CertificateEncryption generateMac.
Also may have a look into Configure Custom Authentication Algorithm.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-13-2022 12:14 AM
I've tried this but it's not working since i need a wordarray to create the token and not a base64 encoded string. This would otherwise work well.