Configuring user claim scripts

Prev Next

User claim scripts generate additional user claims used in policy assignment, entitlements, and conditions. They run after user sign-in and after device claim scripts, but before policy assignment.

Scripts can use existing user, device, and system claims. The claims they generate can be used throughout the system. On the Controller, new claims can be used as policy assignment criteria and are added to the claims token. On the Gateway, they can be used as access criteria in conditions and in entitlement scripts to define protected hosts.


Before configuring user claim scripts

Before you create a user claim script, consider the following:

  • The script runs on the Controller when a user authenticates and when the claims token is renewed.

  • The script runs in a sandboxed JavaScript engine that supports external httpGet/httpPost/httpPut/httpDelete calls.

  • Results from multiple user claim scripts are merged. There is no clear conflict-handling strategy, so one result overrides another.

  • Final claims are not encrypted.


Adding a user claim script

NOTE

To create user claims, your admin role must include the Create Identity Provider privilege.

To add a user claim script:

  1. Go to the User Claim Scripts page (Identity > User Claim Scripts).

  2. Select +Add and complete the following fields:

    • Name. Enter a valid JavaScript name with no whitespaces, dashes, or special characters.

    • Notes. Optional. Add notes for the script.

    • Tags. Select +Add to add tags to the script.

    • Expression. Edit the script in this field. The returned object sets an additional user claim that is included in the unencrypted portion of the claims token.

  3. Save the script.


Enabling user claim scripts

Enable user claim scripts by identity provider (IdP):

  1. Go to the Identity Providers page and select an IdP.

  2. Under User Claim Scripts, select +Add.

  3. In User Claim Scripts, use the drop-down to select a script.  

  4. You can now select the new claim under User Claims in the assignment criteria drop-down lists in Policies and Criteria Scripts, and from the access criteria drop-down list in Conditions.