Advanced Identity Cloud

Configuration Provider node

The Configuration Provider node is a scripted node that dynamically imitates another node and replaces it in the journey.

The script builds a map of configuration properties matching settings for the imitated node. The Configuration Provider node uses the settings to imitate the other node.

Compatibility

Product Compatible?

Advanced Identity Cloud

Yes

PingAM (self-managed)

Yes

Ping Identity Platform (self-managed)

Yes

Inputs

The specific shared state inputs depend on your script and the configuration it builds. The shared state data must include all required Script Inputs properties.

In other words, shared state data must include whatever the Script requires to prepare configuration data for the imitated node.

Dependencies

To prepare to use this node:

  1. Decide what type of node to imitate.

    The imitated node must have a defined set of outcomes. This can be a variable set of outcomes from a predefined list, such as the Polling Wait node, or a fixed set of outcomes, such as the Message node.

    You can’t use a node type whose outcomes are defined entirely by configuration, such as the Scripted Decision node.

  2. Create an appropriate Configuration Provider Node script.

    Base your script on the config-provider-node.js sample.

  3. Get the required configuration properties for the imitated node:

    1. Call the following API endpoint with the configProviderScript action to get a template script for the type of node you want to imitate:

      /realm-config/authentication/authenticationtrees/nodes/node-type?_action=configProviderScript

      For example, the following request returns a base64-encoded template script for a Polling Wait node:

      $ curl \
      --request POST \
      --header "session-cookie-name: tenant-admin-tokenId" \
      --header "Content-Type: application/json" \
      "https://tenant-env-fqdn/json/realm-config/authentication/authenticationtrees/nodes/PollingWaitNode?_action=configProviderScript"
      {
        "script":"LyoqCiAqIFRoZSBmb2xsb3dpbmcgc2.."
      }
    2. Decode the script and adjust the property values as required.

      Your script must have a config object; a map of configuration properties matching the settings of the imitated node. For example, a script for the Polling Wait node has the following structure:

      config = {
          "secondsToWait" : 8,
          "spamDetectionEnabled" : false,
          "spamDetectionTolerance" : 3,
          "waitingMessage" : { },
          "exitable" : false,
          "exitMessage" : { }
        };
  4. Copy the script to the node’s Script field.

    Refer to the example for a script that uses shared state data to set the node configuration.

Configuration

Property Usage

Script

Select the script you created for this node.

Node Type

Select the type of node to imitate. The list is restricted to node types with outcomes that are fixed or variable based on predefined values.

Script Inputs

Optionally, limit the shared state data properties in the shared state input to the selected Script.

Default: * (Any available shared state property)

Outputs

The outputs match those of the imitated node.

Outcomes

The Configuration Provider node inherits the outcomes of its configured Node Type. Connect these as you would the outcomes of the imitated node.

Nodes with a variable set of outcomes inherit all the possible outcomes even if runtime configuration makes them unreachable. Connect these outcomes to the Failure node.

This node also has a Configuration failure outcome. The Configuration failure outcome arises when:

  • The Configuration Provider node failed to build the configuration map.

  • The configuration map is missing required values.

  • The configuration map is invalid.

Errors

In addition to the messages from the imitated node, this node can log the following:

Warnings
  • Failed to collect inputs of contained node: node-type

    A required input property was missing.

  • Failed to get outcome provider for node type.

    The Node Type outcomes were missing.

Errors
  • Failed to configure node: node-type

    This corresponds to the Configuration failure outcome.

To troubleshoot HTTP errors this node causes, refer to the Errors section of the imitated node.

Examples

In the following example, the Configuration Provider node imitates a Message node.

The Configuration Provider settings are the following:

Script

A script to configure a Message node dynamically.

The script accesses the username from shared state data to set the message:

config = {
    "message": {"en-GB": `Hi ${nodeState.get("username")}. Please confirm you are over 18.`},
    "messageYes": {"en-GB": "Confirm"},
    "messageNo": {"en-GB": "Deny"},
    "stateField" : null
}
Node Type

Message Node

Script Inputs

username

The default, *, also works because username is one of the available shared state properties.

The Configuration Provider node is part of a journey where the user enters their username and password before getting the message screen, so their username is in the shared state data. Notice the outcomes of the node include those of the Message node (True, False):

Journey with a [.label]#Configuration Provider# node

When the journey reaches the Configuration Provider node, the script for the node retrieves the username and dynamically configures the node. The Configuration Provider node, imitating a Message node, prompts the user with the message:

A [.label]#Configuration Provider# node imitating a [.label]#Message# node
  • When the user clicks Confirm, the journey continues to the Increment Login Count node.

  • When the user clicks Deny, the journey continues to the Failure node.

  • If the configuration process fails, the node triggers the Configuration failure outcome and the journey continues to the Failure node. In this case, you can find the reason for the failure in the logs.