User provisioning application in Jitterbit App Builder
Introduction
This page shows you how to create a user provisioning application that front-end users can use to provision application access in a semi-automated way, without needing access to the IDE. This is an alternative approach to managing user access when an identity provider (such as Okta or Azure) is not available.
The process involves creating security providers, configuring realms, preparing the data model, building a sequence of business rules to handle the logic, and creating a simple UI for front-end users to trigger the process.
These instructions use the example of providing a company's employees with access. The instructions are divided into five steps:
Preparation
To start, create a dedicated app to provision users. The one used in this tutorial is called simply User Provisioning App and starts with the following tables:
| Table | Columns |
|---|---|
Employee |
EmployeeID (Unique ID, PK), FullName (String), Email (String), EmployeeNo (String) |
Department |
DepartmentID (Unique ID, PK), Name (String) |
Parameter |
ParameterID (Unique ID, PK) |
Additional columns are added to these tables during the steps below.
Step 1: Initial configuration
First, you need a security provider to handle the provisioning, and a place to store its configuration details.
Create a security provider
To create a security provider, follow these steps:
-
Select IDE > Security Providers.
-
Under User Authentication, click + User Authentication.
-
Configure the provider with these settings:
-
Name:
User ProvisioningNote
Not to be confused with the provisioning app itself, which is called
User Provisioning App. -
Type: User Provisioning
-
Enabled: Checked.
-
User Provisioning: Checked.
-
-
Click Save.
-
Copy and save the new provider's Identifier key for the next step.
Parameterize the configuration
To store the provider ID and a default password in your application's Parameter table, follow these steps:
-
Run your user provisioning app, then go to the App Workbench Tables tab.
-
Under Tables, find the Parameter table, then click its Open record icon.
-
Add the following two columns:
-
MyProviderID(Type: Unique ID) -
DefaultPassword(Type: String)
-
-
Go to the App Workbench Pages tab.
-
Under Pages, find the Parameter page, then click its icon.
-
Add new controls (control type Text) to the page for the
MyProviderIDandDefaultPasswordcolumns. -
Run the application and select Configuration > Parameters. The Parameters popup opens.
-
Click Edit.
-
Paste the security provider identifier (copied earlier) into the MyProviderID field.
-
Enter a secure default password in the DefaultPassword field. This is the password that is assigned to new users.
-
Click Save, then close the Parameter popup.
Step 2: Configure access control
With the provider created, you can now configure the user groups and realms that govern access. To do this, follow these steps:
-
Select IDE > User Management.
-
Select the Groups tab.
-
Click + Group. The Group popup opens.
-
Set the following values:
-
Name:
Demo General User -
Description:
General user permissions for the demo app.
-
-
Click Save, then close the Group popup.
-
Under Groups, click Manage Privileges for the new group.
-
Under Privileges, click Create. The Privilege popup opens.
-
Set the following values:
-
Type: Select Application.
-
Application: Open the menu and select the app that end users will access.
Note
The app you should select here is the one that end users will log in to. This may or may not be the provisioning app itself. In this tutorial, a dedicated provisioning app was built to manage access to one or more apps, therefore you should select the target app here, not the provisioning app.
-
-
Click Save, then close the Privileges/Roles panel.
-
Under Roles, grant the appropriate roles for general users.
-
Select the Realms tab.
-
Click + Realm.
-
Enter
Demo Realmas the name, then click the icon. -
In the Applications tab, click Select for the app that end users will access.
-
Select the Groups tab, then click Select for the
Demo General Usergroup just created. -
Select the Providers tab, then click Select for the
User Provisioningsecurity provider created earlier.
Step 3: Prepare the data model
Now you must update your Department and Employee tables to store security information and provisioning status.
Link Departments to security groups
Follow these steps:
-
With your app running, go to the App Workbench Data Sources tab.
-
Click + Source.
-
Select Link to existing source, then click Next.
-
Find and select App Builder (Sealed) (Default), then click Link 1 Source and Done. This gives you access to public data objects needed for provisioning.
-
Go to the App Workbench Tables tab.
-
Under Tables, find the
Departmenttable, then click its Open record icon. -
Add a new column named
MyGroupID(Type: Unique ID). -
Go to the App Workbench Pages tab, then open your
Departmentpage for editing. -
Add the
MyGroupIDcontrol to your page. Set its Control Type to List, then click Next. -
On the next page, set these values, then click Next:
-
Source:
Realm_Group -
Key (Column):
GroupId (PK) -
Title (Column):
Name
-
-
Click Finish.
-
Go to the App Workbench Pages tab, then open your
Departmentpage for editing. -
Select the Update Methods tab.
-
Ensure the Edit Method setting is Standard.
-
Run the application, navigate to the Departments page, and assign the
Demo General Usergroup to one of your departments.
Update the Employee table
Follow these steps:
-
Go to the App Workbench Tables tab.
-
Under Tables, find the
Employeetable, then click its Open record icon. -
Add the following columns:
-
MyUserID(Type: Unique ID): Stores the user's App Builder ID after creation. -
ProvisionedOn(Type: DateTime): A timestamp for when provisioning occurred. -
ProvisionedBy(Type: String, length: 150): The name of the user who performed the provisioning.
-
Step 4: Build the provisioning logic
The core of the application is a table-level event on the Employee table that orchestrates a sequence of rules. These rules run one after another using success handlers.
Rule 1: Create the user
This rule creates the user record, but only if one does not already exist. Follow these steps:
-
Go to the App Workbench Tables tab.
-
Under Tables, find the
Employeetable, then click its Open record icon. -
Click Events. The Data Storage Events (Employee) popup opens.
-
Click + Table Event.
-
Under Event Information, set the Name as
Provision User, then click Save. -
Under Actions, click + Rule & Register.
-
On the Rule Builder page, set the following values:
-
Name:
Realm_User_Create (Insert Employee) -
Purpose: XP CRUD
-
Action: Insert
-
Source Data Source: Select the user provisioning app you've created. In this tutorial, it's
User Provisioning App. -
Target Data Source:
Vinyl (Sealed) -
Options: Select Logic Layer.
-
Target:
Realm_User_Create
-
-
Click Create.
-
With the Tables tab selected, click + Table.
-
In the Current Data Source tab, add the
Employeetable. -
Select the Where tab.
-
Click + Where Clause.
-
Under Left Expression, enter
E.MyUserID. -
Open the Operator menu, then select IS NULL.
-
Click Save, then close the Where popup.
-
Select the Tables tab, then select
EmployeeIDand any additional columns the rule needs for its action (for example, the provisioned user's name and email address). -
Select the Columns tab, and set fields as follows:
Column or Expression Alias Target PK E.EmployeeIDUserId (PK)E.FullNameFullNameE.EmailEmailAddressE.FullNameDisplayNameDisplayNameE.EmployeeNoUserNameUserName -
(Optional, but recommended) Select the Results tab and click Validate.
-
Go to the App Workbench Tables tab.
-
Under Tables, find the
Employeetable, then click its Open record icon. -
Click Events. The Data Storage Events (Employee) popup opens.
-
Click the Open record icon for the Provision User event.
-
Under Actions, click the Open record icon for the Realm_User_Create (Insert Employee) rule.
-
Under Bindings, click + Binding.
-
Set the following binding:
Source Column Rule Column EmployeeIDEmployeeID -
Click the icon, then close the Action/Bindings/SQL popup.
Rule 2: Update the employee record
After the App Builder user is created by Rule 1, this rule writes the new user's ID back into the MyUserID field on the Employee table. This links the employee record to their App Builder account so that subsequent rules can reference their ID.
-
On the Event/Validations/Actions page, under Actions, click + Rule & Register.
-
Set the following values:
-
Name:
Employee (Update MyUserID to EmployeeID) -
Purpose: CRUD
-
Action: Update
-
Target Layer: Data Layer
-
Target:
Employee
-
-
Click Create.
-
Select the Columns tab.
-
Click + Column.
-
In the Column or Expression box, enter
E.EmployeeID, then set these remaining values:-
Alias:
MyUserID -
Target:
MyUserID -
TargetType: Target
-
-
Click Save, then close the Add Column popup.
-
(Optional, but recommended) Select the Results tab and click Validate.
-
Click < Event to return to the Provision User page (Event/Validations/Actions).
-
Under Actions, click to deregister the just added and registered rule (Employee (Update MyUserID to EmployeeID)), then click Proceed.
-
Under Actions, click the Open record icon for the remaining Realm_User_Create (Insert Employee) action. The Action/Bindings/SQL popup opens.
-
Click Success. The Success Handlers popup opens.
-
Click Create. The Action popup opens.
-
Set the following values:
-
Type: Rule
-
Rule: Select Employee (Update MyUserID to EmployeeID)
-
-
Click Save.
-
Under Bindings, click + Binding.
-
Set the following binding:
Source Column Rule Column EmployeeIDEmployeeID -
Close the popups to return to the Event/Validations/Actions page for Provision User.
Tip
The number 1 next to the icon indicates the presence of a success handler for this action.
Rule 3: Set the user password
This rule sets the new user's initial password using the default value stored in the Parameter table.
-
Go to the App Workbench Rules tab.
-
Click + Rule.
-
Set the values as follows:
-
Name:
User_SetPassword (Update Default Password) -
Purpose: Select XPCRUD
-
Action: Update
-
Source Data Source: Select the user provisioning app you've created. In this tutorial, it's
User Provisioning App. -
Target Data Source:
Vinyl (Sealed) -
Target Layer: Logic Layer
-
Target:
User_SetPassword
-
-
Click Create.
-
Select the Tables tab.
-
In the Current Data Source tab, click + Table, then add the
EmployeeandParametertables. -
In the Employee table, select the EmployeeID and MyUserID columns.
-
In the Parameter table, select the DefaultPassword column.
-
Select the Columns tab, and set fields as follows:
Column or Expression Alias Target PK E.MyUserIDUserID (PK)P.DefaultPasswordPassword -
(Optional) Click the Open record icon for the
E.MyUserIDcolumn. In the Column popup, confirm that the Target Type is Bind. -
(Optional) Click the Open record icon for the
P.DefaultPasswordcolumn. In the Column popup, confirm that the Target Type is Target. -
Select the Where tab, then click + Where Clause.
-
Under Left Expression, enter
E.MyUserID. -
Open the Operator menu, then select IS NOT NULL.
-
Click Save, then close the Where popup.
-
Go to the App Workbench Rules tab.
-
Under App Data Sources, select All Events.
-
Under All Events, click Provision User in the Event column.
-
For the Provision User entry, click Rule Event Detail.
-
Under Actions, click the Success handlers icon for the Realm_User_Create (Insert Employee) rule. The Success Handlers popup opens.
-
Click Create. The Action popup opens.
-
Set the following values:
-
Type: Rule
-
Rule: Select User_SetPassword (Update Default Password)
-
-
Click Save.
-
Under Bindings, click + Binding.
-
Set the following binding:
Source Column Rule Column EmployeeIDEmployeeID -
Close the popups to return to the Event/Validations/Actions page for Provision User.
-
Refresh the page, and note the number of success handlers for the Realm_User_Create (Insert Employee) rule is now 2.
Rule 4: Grant group access
This rule grants the new user access to the App Builder group associated with their department, using the MyGroupID value set in the Department table.
-
Go to the App Workbench Rules tab.
-
Click + Rule.
-
Set the values as follows:
-
Name:
Realm_UserGroup (Cram Department) -
Purpose: Select XPCRUD
-
Action: Cram
-
Source Data Source: Select the user provisioning app you've created. In this tutorial, it's
User Provisioning App. -
Target Data Source:
Vinyl (Sealed) -
Target Layer: Logic Layer
-
Target:
Realm_UserGroup
-
-
Click Create.
-
Select the Tables tab.
-
In the Current Data Source tab, click + Table, then add the
EmployeeandDepartmenttables.Tip
App Builder automatically creates a foreign key relationship between the two tables'
DepartmentIDcolumns. -
In the Employee table, select the EmployeeID and MyUserID columns.
-
In the Department table, select the MyGroupID column.
-
Select the Where tab, then click + Where Clause.
-
Under Left Expression, enter
D.MyGroupID. -
Open the Operator menu, then select IS NOT NULL.
-
Click Save, then close the Where popup.
-
Click + Where Clause.
-
Under Left Expression, enter
E.MyUserID. -
Open the Operator menu, then select IS NOT NULL.
-
Click Save, then close the Where popup.
-
Select the Columns tab, and set fields as follows (for example):
Column or Expression Alias Target PK E.EmployeeIDE.MyUserIDUserID (PK)D.MyGroupIDGroupID (PK) -
Select More > Edge Case. The Edge Case Settings popup opens.
-
Enable the Select Distinct option, then close the popup.
-
Go to the App Workbench Rules tab.
-
Under App Data Sources, select All Events.
-
Under All Events, click Provision User in the Event column.
-
For the Provision User entry, click Rule Event Detail.
-
Under Actions, click the Open record icon for the Realm_User_Create (Insert Employee) rule.
-
Click Success. The Success Handlers popup opens.
-
Click Create. The Action popup opens.
-
Set the following values:
-
Type: Rule
-
Rule: Select Realm_UserGroup (Cram Department)
-
-
Click Save.
-
Under Bindings, click + Binding.
-
Set the following binding:
Source Column Rule Column EmployeeIDEmployeeID -
Close the popups to return to the Event/Validations/Actions page for Provision User.
Rule 5: Log the provisioning action
This rule records who triggered the provisioning and when, by writing the current timestamp and the logged-in user's name to the ProvisionedOn and ProvisionedBy fields on the Employee table.
-
Go to the App Workbench Rules tab.
-
Click + Rule.
-
Set the following values:
-
Name:
Employee (Update ProvisionedOn/By) -
Purpose: CRUD
-
Action: Update
-
Target Layer: Data Layer
-
Target:
Employee
-
-
Click Create.
-
Select the Columns tab.
-
Click + Column.
-
In the Column or Expression box, enter
now(), then set these remaining values:-
Target:
ProvisionedOn -
TargetType: Target
-
-
Click Save, then close the Add Column popup.
-
Click + Column.
-
In the Column or Expression box, enter
who(), then set these remaining values:-
Target:
ProvisionedBy -
TargetType: Target
-
-
Click Save, then close the Add Column popup.
-
(Optional, but recommended) Select the Results tab, then click Validate.
-
Go to the App Workbench Rules tab.
-
Under App Data Sources, select All Events.
-
Under All Events, click Provision User in the Event column.
-
For the Provision User entry, click Rule Event Detail.
-
Under Actions, click the Success handlers icon for the Realm_User_Create (Insert Employee) rule. The Success Handlers popup opens.
-
Click Create. The Action popup opens.
-
Set the following values:
-
Type: Rule
-
Rule: Select Employee (Update ProvisionedOn/By)
-
-
Click Save.
-
Under Bindings, click + Binding.
-
Set the following binding:
Source Column Rule Column EmployeeIDEmployeeID -
Close the popups to return to the Event/Validations/Actions page for Provision User.
Step 5: Create the user interface
-
Navigate to Pages and open your
Employeepage for editing. -
Add a new Button control with the label
Provision User. -
In the button's properties, navigate to the Events tab and select the
Provision Userevent. -
To ensure the UI updates correctly, in the Behavior tab, set the Refresh Scope to Row.
-
To hide the button for already-provisioned users, go to the Visibility tab and add a condition:
ProvisionedOn IS NOT NULL.
Next steps
The core provisioning logic is now complete. You can enhance this process further by:
-
Adding a workflow event to email new users their login credentials (see Email in Notifications).
-
Using other public data objects to require a password change on first login (see User_LocalAuthentication public data object).
-
Expanding the rule set to handle de-provisioning users (see Realm_UserGroup public data object).