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.jsonfile in your project’sconfdirectory. There are a number of stages in that process by default; for example, theparametersstage:"stageConfigs" : [ { "name" : "parameters", "parameterNames" : [ "returnParams" ] }, ... ] -
Add your custom stage to the process by creating a configuration item in the
stageConfigsarray:"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 statethat has been populated by a preceding stage. For the purposes of this example, add theMathProblemstage directly after theparametersstage. -
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" : falseinselfservice-registration.json. For more information, refer to All-in-one registration. -
Save the changes to the
selfservice-registration.jsonfile.IDM reloads the configuration automatically—you do not need to restart the server.
-
Log in to the End User UI (
https://localhost:8443by default), and click Register.IDM displays the Math Problem you configured previously.