The example presented is only useful to demonstrate the capabilities of the scriptable step and how it can interact with Airlock IAM. The example is limited because most useful use cases require either proprietary services or services behind a paywall.
The example implements a self-registration flow that verifies secrets with a REST API, registers the user with another REST API, and summarizes the success in an HTML-formatted message:
The template of this flow has been taken from the Demo Configuration bundled with Airlock IAM.
- This flow has been changed to show the following, scripting-related properties:
- A Scriptable Step implements a REST call to a 3rd party system that requires basic auth and returns success/failure status to Airlock IAM.
- An Acknowledge Message Step is displayed depending on the status output of the previous scriptable step. It will set a tag that forces all the following steps to be skipped in case of an error.
- A Scriptable Step implements a
POST
request to a 3rd party system to retrieve data for display. - A Scriptable Step to generate an HTML snippet with the data from the previous step and to return this to Airlock IAM.
- An Acknowledge Message Step that displays the HTML snippet from the previous step.
- To use the example as intended, you can simulate the following two situations:
- If the user interactively chooses the same password as configured as secret in the first scriptable step, the self-registration flow will continue successfully.
- If the user chooses a different password, the first scriptable step will fail and all the following steps will be skipped and the self-registration will not be successful.