Page settings allow configuring the behavior of certain UI pages. Some pages do not have any settings while others like the configurable UI require significant settings configurations.
Basic configuration and lookup strategy
UI page settings are configured using config.pages
section in custom.sdk.config.js
.
- The
config.pages
section consists of an array of page settings: - Each entry defines the path of the page.
- The first entry whose path matches the current browser URL is used to for rendering the page.
- The path may contain a placeholder
FLOW
to resolve the flow ID at runtime or the flow ID may be hard coded.
config.pages = [ // Password page { path: '/auth/flow/{{FLOW}}/password', ... }, // Password change page { path: '/auth/flow/fixed-flow-id/password/change', ... }, ... ];
The above example shows two entries in config.pages
. One uses the FLOW
placeholder, the other hardcoding the flow ID.
Page settings currently do not support the use of stepId and all steps will use the same configuration.
Full page settings configuration
The following code block shows the full configuration of the config.pages
section supported by the Loginapp Design Kit:
To clear a value, use null
. The following example removes the password reset link and the user self-registration link on the password page:
config.pages = [ { path: '/auth/flow/{{FLOW}}/password', pageSettings: { passwordResetLink: null, userSelfRegistrationLink: null } } ];
Field-based validation messages
Validation messages are configured separately for each page. The following example demonstrates how a validations
section is added to the password page:
In the above example, the UI fields for username and password are configured to display validation messages. Parameters to the validation message translation can be passed using arguments.
Custom configuration-based UI
Custom UIs are a special type of UIs that are characterized by their dynamic nature. While the content on most product pages is fixed, the content on custom UIs is either determined by a server-side configuration or by JavaScript.
The configuration of Airlock IAM provides a configuration option based on the Custom Configuration-Based UI plugin that enables administrators to configure the fields to display in a UI. Since the Loginapp Design Kit operates without an actual IAM instance, it provides means to define the content of the configuration-based UI. Below is a configuration showing the usage of each available type of UI control:
Note that the custom configuration-based UI must be added to customUi
of the navigation menu.
The Loginapp UI uses /ext
path for pages that were explicitly configured using the Custom Configuration-Based UI plugin. However, IAM is also able to automatically infer the UI configuration for certain steps which results in pages being available using data instead of /ext
in their path. For example: /auth/flow/{{FLOW}}/data/example
. The underlying mechanisms and the configuration in the Design Kit however are the same.
Adding CAPTCHAs to custom pages
Two external CAPTCHA services are supported by Airlock IAM, reCAPTCHA and hCAPTCHA.
- To add a CAPTCHA element on a custom page:
- Add the
type: 'captcha'
to the list ofuiElements
(see example code in section Custom configuration-based UI). - Define the path and CAPTCHA type in the page settings (see example code in section Full page settings configuration).
Overwriting automatic type formatting
For type: 'input'
fields, validators are used to set the type of input (e.g. type: 'text'
). To overwrite the validator, add a corresponding subtype to the type: 'input'
section:
config.pages = [ { path: '/auth/flow/{{FLOW}}/ext/example', uiElements: [ { type: 'form', uiElements: [ { type: 'input', subtype: 'email', htmlId: 'itemUsername', label: 'authentication.data.item-label.username', property: 'username', }, ...
- Frequently used supported subtypes are:
'text'
'email'
'password'
'number'
Note that other input types may also be used with limited support. For example, there is no out-of-the-box support for formatting when using the subtype 'date'
.
A list of all possible values applicable as subtypes can be found here: (w3schools) HTML input types.
Custom JavaScript-Based UI
Even more flexible are pages that are entirely written in JavaScript and configured using the Custom JavaScript-Based UI plugin in an IAM instance. A custom JavaScript-based UI is nothing else than a custom configuration-based UI using an empty array for uiElements
:
config.pages = [ { path: '/auth/flow/{{FLOW}}/ext/example', uiElements: [] } ];
As mentioned, the page must be added to a customUi
section of the navigation menu.
Further information and links
- Menu-related customization: Loginapp Design Kit navigation menu configuration
- Customizing the CAPTCHA look and feel
- More details about how to write an entire page using JavaScript: Adding new pages using the Loginapp Design Kit
- A list of HTML subtypes (some with only limited support) can be found here: (w3schools) HTML input types
- For CAPTCHAs in IAM flow configurations, see CAPTCHAs in the Loginapp REST API and the Loginapp UI.