one time password for new Users

DB1
Tera Contributor

Hi All,

I am looking for some help where the requirement is as follows:

1. New User should be created via catalog - This is done and working

2. Notification should be sent to user with a One time password and forcing them to reset the password momentarily while this OTP is entered.

Look forward for the help. TIA

 

1 ACCEPTED SOLUTION

Hi @DB 

Is your issue resolved?


Feel free to mark correct, if your issue has been resolved, so it ends up in solved queue.

Will be helpful for others looking for the similar query.

Best Regards
Aman Kumar

View solution in original post

14 REPLIES 14

So the credentials seems to be incorrect, how are you setting the password in the user form?

If using script, use setDisplayValue() instead of setValue()

and use userid and password for login

You can also try to set manually in the user record the password then check by logging

Best Regards
Aman Kumar

DB1
Tera Contributor

I am using the below script in After Insert BR

(function executeRule(current, previous /*null when async*/ ) {

    var chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXTZabcdefghiklmnopqrstuvwxyz";
    var string_length = 8;
    var randomstring = '';

    for (var i = 0; i < string_length; i++) {
        var rnum = Math.floor(Math.random() * chars.length);

        randomstring += chars.substring(rnum, rnum + 1);

        //gs.eventQueue()
    }

    gs.eventQueue("user.password", current, randomstring, current.email);

    current.user_password.setDisplayValue(randomstring);
    current.password_needs_reset = true;
    current.update();
})(current, previous);

Use before Update BR, we are not supposed to use current.update() in BRs, or event if you want to use, also include current.setWofklow(false);

Best Regards
Aman Kumar

DB1
Tera Contributor

Still same issue with before insert BR.

But looks like because of the below error it is generating same passwordfind_real_file.png

What is your BR condition? When does it trigger?

Did you try manually setting the password and try to login with the creds?

Best Regards
Aman Kumar