ReferenceError KJUR is not defined

Hi all,
please I’d like to share this problem I have when I use this library on a Pre-request-script. It is important to highlight that this is not a problem of the script or request, because this same environment is used on other Windows x64 PC and it works OK, however when I use it on my laptop, for any reason, it fails.
I’ve tried updating postman to the last version, even using the web environment, but on this pc the problem keeps returning error.

var sToken = KJUR.jws.JWS.sign(header, Header, Payload, jwtKey);
Response error: :grimacing:
There was an error in evaluating the Pre-request Script:ReferenceError: KJUR is not defined

This same request through my postman internet account on other pc using W10 runs OK. Of course I’ve not modified any configuration of the settings.

Thanks a lot for your help.

KJUR is a variable, so how are you setting that variable?

If its an environment variable, then it might be the initial vs current values that catches people out.

Initial values are synced to the Postman cloud, current values are not.

Thanks Mike, but finally I was able to find the problem.
For any reason either, my anti-virus blocks the access to the url of the library or is the proxy of my network.
As you say KJUR is an opensource JavaScript cryptographic library: that is mapped as a global library on Postman.

I manually entered its code on the ‘jsrsasign-js’ global variable and now it works OK. So this is a feasible solution.

Thanks a lot.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.