Test the custom stage
Stages are implemented as part of a self-service process. To test your custom stage, you need to add it to a self-service process. You can create a new process, or use one of the default processes available through the admin UI.
In this example, we add the custom stage to the User Registration process and test it as part of self-registration, as follows:
-
From the navigation bar, click Configure > User Registration, and activate Enable User Registration.
IDM creates a
selfservice-registration.json
file in your project’sconf
directory. There are a number of stages in that process by default; for example, theparameters
stage:"stageConfigs" : [ { "name" : "parameters", "parameterNames" : [ "returnParams" ] }, ... ]
-
Add your custom stage to the process by creating a configuration item in the
stageConfigs
array:"stageConfigs" : [ { "name" : "parameters", "parameterNames" : [ "returnParams" ] }, { "class" : "org.forgerock.selfservice.custom.MathProblemStageConfig", "leftValue" : 12, "rightValue" : 4 }, ... ]
Self-service stages can generally not be configured in random order. For example, some stages require input from the process state
that has been populated by a preceding stage. For the purposes of this example, add theMathProblem
stage directly after theparameters
stage. -
Disable all-in-one registration.
By default, the registration phase has all-in-one registration enabled. All-in-one registration covers a number of registration stages. For the purposes of testing the custom stage, disable all-in-one registration by setting
"allInOneRegistration" : false
inselfservice-registration.json
. For more information, see All-in-one registration. -
Save the changes to the
selfservice-registration.json
file.IDM reloads the configuration automatically—you do not need to restart the server.
-
Log in to the End User UI (
https://localhost:8443
by default), and click Register.IDM displays the Math Problem you configured previously.