</script>
JavaScript Changes
./ui/default/enduser/public/org/forgerock/openidm/ui/user/UserRegistrationView.js
Here we setup the registration code such that it allows the user to setup 2 security questions at the time of self-registration.
./ui/default/enduser/public/templates/user/ChangeSecurityDataDialogTemplate.html
Change the template to include the option of setting up 2 security questions instead of a default of one OpenIDM ships with:
./ui/default/enduser/public/org/forgerock/openidm/ui/user/profile/ChangeSecurityDataDialog.js
In the javascript, we need to ensure that whenever the user wants to change their security questions, the previously configured ones show up as selected:
Note that this demo does not attempt to manage the UI display order of the previous security questions.
This code change in UserDelegate.js enables randomly showing any of the 2 configured security questions.
./ui/default/enduser/public/org/forgerock/openidm/ui/user/delegates/UserDelegate.js
When a user has forgotten their password, they need to click on the Forgot Password link. The security question presented to them is randomly selected from the 2 configured list of questions.
The following REST calls are made to manage a user’s password reset.
The list of security questions can be received via this API call:
GET
This pulls up the security question(s) defined for the user indicated by user-name:
POST
A security response can be submitted to OpenIDM via:
POST
Once the user has entered the correct security response, you may change the password via this API call:
POST