How can we generate Random salt of 32 bytes in js script for FR IC?
Karan Nayyar
I wanted to generate a random salt of 32 bytes size. I know SecureRandom class can be used for the same. However,this is blacklisted in our dev tenant.Is there an API which can be used in js script to generate same?
I never used this class in a script. For a PoC maybe you could just generate your salt manually. See below an example to generate a random number.
function createRandom() { return 'xxxxxxxxxxxxxxxxxxxxxxxx'.replace(/[x]/g, function(c) { var r = Math.random()*16|0; var v = r; return v.toString(16); }); }
We have recently rolled out a change to allow access to org.forgerock.openam.shared.security.ThreadLocalSecureRandom . This class is a wrapper for java.security.SecureRandom and provides the following public static method: