PingCentral

Creating and testing approval expressions

Configure a Spring Expression Language (SpEL) expression to manage promotion approval requirements for your environment.

Before you begin

When you configure an environment, on the Connection page, select Require Approval If Any Expression Fails or Require Approval If Any Expression Succeeds from the Approval Expression list. For more information, see Adding environments.

About this task

You can use SpEL expressions to determine whether an application requires approval or not. For more information on SpEL, see Spring Expression Language (SpEL) in the Spring Framework documentation. TIP: The approval expression should handle different application types and the promotional configurations associated with each application type.

Steps

  1. On the Connection page, in the Approval Expression field, click Test to expand the Test Spring Expression window.

    Result:

    The Test Spring Expression window displays.

  2. In the Application Configuration field, enter the application configuration information as a JSON payload.

    The available variables include:

    • #application: This variable can correspond to several modals, depending on the application’s type, which can be either OAuth, OIDC, SAML_20_SP, or PINGACCESS.

    • #oAuthApplicationPromotion: Corresponds to the ClientApplicationView modal.

    • #pingAccessApplicationPromotion: Corresponds to the PingAccessApplicationView modal.

    • #samlSpApplicationPromotion: Corresponds to the ConnectionApplicationView modal.

  3. Optional: In the Promotion Configuration field, enter the promotion configuration as a JSON payload.

  4. Under the Spring Expression field, click Test Expression to test your SpEL expression.

    Result:

    The Spring Expression result displays.

    For information about approval expression handling, see the following:

    • If you selected Require Approval If Any Expression Fails from the Approval Type list: If any expression results in false then approval is required. If all expressions are true then approval is not required.

    • If you selected Require Approval If Any Expression Succeeds from the Approval Type list: If any expression results in true then approval is required. If all expressions are false then approval is not required.

    • If any of the expressions do not return a Boolean value or if there are any errors in the expressions, the promotions will require approval.

    • Multiple expressions can be added, and are evaluated sequentially from top to bottom in an IF/ELSE chain. You can change the order in which these expressions display in the list by dragging and dropping them into different locations within the list.

  5. Click the Update button to save your configuration or click the Cancel button to discard it.