--- title: "Configuring user claim scripts" slug: "configure-user-claim-scripts-v7-0" description: "Learn how to create and enable user claim scripts for policy assignment, entitlements, and conditions in your system after user sign-in." tags: ["Scripts", "User Claims", "User Claim Scripts"] updated: 2026-09-15T19:24:40Z published: 2026-09-15T19:24:40Z canonical: "support.appgate.com/configure-user-claim-scripts-v7-0" --- > ## Documentation Index > Fetch the complete documentation index at: https://support.appgate.com/llms.txt > Use this file to discover all available pages before exploring further. # Configuring user claim scripts User claim [scripts](/v1/docs/configure-conditions-v7-0#access-criteria1) 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] > **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](/v1/docs/identity-providers-v7-0) 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](/v1/docs/configure-policies-v7-0) and [Criteria Scripts](/v1/docs/criteria-scripts-v7-0), and from the access criteria drop-down list in [Conditions](/v1/docs/configure-conditions-v7-0).