|
| 1 | +--- |
| 2 | +title: 'Tutorial: Configure Torii for automatic user provisioning with Azure Active Directory | Microsoft Docs' |
| 3 | +description: Learn how to automatically provision and de-provision user accounts from Azure AD to Torii. |
| 4 | +services: active-directory |
| 5 | +author: twimmers |
| 6 | +writer: twimmers |
| 7 | +manager: beatrizd |
| 8 | +ms.assetid: e6cfe864-b106-4d24-9070-03864e5dfb83 |
| 9 | +ms.service: active-directory |
| 10 | +ms.subservice: saas-app-tutorial |
| 11 | +ms.workload: identity |
| 12 | +ms.topic: tutorial |
| 13 | +ms.date: 03/09/2023 |
| 14 | +ms.author: thwimmer |
| 15 | +--- |
| 16 | + |
| 17 | +# Tutorial: Configure Torii for automatic user provisioning |
| 18 | + |
| 19 | +This tutorial describes the steps you need to perform in both Torii and Azure Active Directory (Azure AD) to configure automatic user provisioning. When configured, Azure AD automatically provisions and de-provisions users to [Torii](https://toriihq.com) using the Azure AD Provisioning service. For important details on what this service does, how it works, and frequently asked questions, see [Automate user provisioning and deprovisioning to SaaS applications with Azure Active Directory](../app-provisioning/user-provisioning.md). |
| 20 | + |
| 21 | + |
| 22 | +## Supported capabilities |
| 23 | +> [!div class="checklist"] |
| 24 | +> * Create users in Torii. |
| 25 | +> * Remove users in Torii when they do not require access anymore. |
| 26 | +> * Keep user attributes synchronized between Azure AD and Torii. |
| 27 | +> * [Single sign-on](torii-tutorial.md) to Torii (recommended). |
| 28 | +
|
| 29 | +## Prerequisites |
| 30 | + |
| 31 | +The scenario outlined in this tutorial assumes that you already have the following prerequisites: |
| 32 | + |
| 33 | +* [An Azure AD tenant](../develop/quickstart-create-new-tenant.md) |
| 34 | +* A user account in Azure AD with [permission](../roles/permissions-reference.md) to configure provisioning (for example, Application Administrator, Cloud Application administrator, Application Owner, or Global Administrator). |
| 35 | +* An administrator account with Torii. |
| 36 | + |
| 37 | +## Step 1. Plan your provisioning deployment |
| 38 | +1. Learn about [how the provisioning service works](../app-provisioning/user-provisioning.md). |
| 39 | +1. Determine who will be in [scope for provisioning](../app-provisioning/define-conditional-rules-for-provisioning-user-accounts.md). |
| 40 | +1. Determine what data to [map between Azure AD and Torii](../app-provisioning/customize-application-attributes.md). |
| 41 | + |
| 42 | +## Step 2. Configure Torii to support provisioning with Azure AD |
| 43 | +1. Log in to [Torii admin console](https://app.toriihq.com). |
| 44 | +1. Navigate to [Settings](https://app.toriihq.com/team/settings/apiAccess) page **> Security**, enable the SCIM toggle. |
| 45 | + |
| 46 | +1. Navigate to the **API Access** tab. From here, you can view and manage the Torii API keys and SCIM. |
| 47 | +1. Click on **Generate API Key** to generate a new SCIM. |
| 48 | + |
| 49 | +1. Choose type: **SCIM**. |
| 50 | +1. Add **Description** and set **Expiration date**. For security purposes, we recommend setting an expiration date when generating a new key. |
| 51 | +1. Click **Generate key**. |
| 52 | +1. Copy and save the API Key as it won't be available next. This value will be entered in the **Secret Token** field in the Provisioning tab of your Torii application in the Azure portal. |
| 53 | +1. Click **Got it**. |
| 54 | + |
| 55 | +1. **Torii Tenant Url:** `https://api.toriihq.com/v1.0/scim/v2` will be entered in the **Tenant URL** field in the Provisioning tab of your Torii application in the Azure portal. |
| 56 | + |
| 57 | +## Step 3. Add Torii from the Azure AD application gallery |
| 58 | + |
| 59 | +Add Torii from the Azure AD application gallery to start managing provisioning to Torii. If you have previously setup Torii for SSO you can use the same application. However it's recommended that you create a separate app when testing out the integration initially. Learn more about adding an application from the gallery [here](../manage-apps/add-application-portal.md). |
| 60 | + |
| 61 | +## Step 4. Define who will be in scope for provisioning |
| 62 | + |
| 63 | +The Azure AD provisioning service allows you to scope who will be provisioned based on assignment to the application and or based on attributes of the user. If you choose to scope who will be provisioned to your app based on assignment, you can use the following [steps](../manage-apps/assign-user-or-group-access-portal.md) to assign users to the application. If you choose to scope who will be provisioned based solely on attributes of the user or group, you can use a scoping filter as described [here](../app-provisioning/define-conditional-rules-for-provisioning-user-accounts.md). |
| 64 | + |
| 65 | +* Start small. Test with a small set of users before rolling out to everyone. When scope for provisioning is set to assigned users, you can control this by assigning one or two users to the app. When scope is set to all users, you can specify an [attribute based scoping filter](../app-provisioning/define-conditional-rules-for-provisioning-user-accounts.md). |
| 66 | + |
| 67 | +* If you need more roles, you can [update the application manifest](../develop/howto-add-app-roles-in-azure-ad-apps.md) to add new roles. |
| 68 | + |
| 69 | + |
| 70 | +## Step 5. Configure automatic user provisioning to Torii |
| 71 | + |
| 72 | +This section guides you through the steps to configure the Azure AD provisioning service to create, update, and disable users in TestApp based on user and/or group assignments in Azure AD. |
| 73 | + |
| 74 | +### To configure automatic user provisioning for Torii in Azure AD: |
| 75 | + |
| 76 | +1. Sign in to the [Azure portal](https://portal.azure.com). Select **Enterprise Applications**, then select **All applications**. |
| 77 | + |
| 78 | +  |
| 79 | + |
| 80 | +1. In the applications list, select **Torii**. |
| 81 | + |
| 82 | +  |
| 83 | + |
| 84 | +1. Select the **Provisioning** tab. |
| 85 | + |
| 86 | +  |
| 87 | + |
| 88 | +1. Set the **Provisioning Mode** to **Automatic**. |
| 89 | + |
| 90 | +  |
| 91 | + |
| 92 | +1. Under the **Admin Credentials** section, input your Torii Tenant URL and Secret Token. Click **Test Connection** to ensure Azure AD can connect to Torii. If the connection fails, ensure your Torii account has Admin permissions and try again. |
| 93 | + |
| 94 | +  |
| 95 | + |
| 96 | +1. In the **Notification Email** field, enter the email address of a person or group who should receive the provisioning error notifications and select the **Send an email notification when a failure occurs** check box. |
| 97 | + |
| 98 | +  |
| 99 | + |
| 100 | +1. Select **Save**. |
| 101 | + |
| 102 | +1. Under the **Mappings** section, select **Synchronize Azure Active Directory Users to Torii**. |
| 103 | + |
| 104 | +1. Review the user attributes that are synchronized from Azure AD to Torii in the **Attribute-Mapping** section. The attributes selected as **Matching** properties are used to match the user accounts in Torii for update operations. If you choose to change the [matching target attribute](../app-provisioning/customize-application-attributes.md), you'll need to ensure that the Torii API supports filtering users based on that attribute. Select the **Save** button to commit any changes. |
| 105 | + |
| 106 | + |Attribute|Type|Supported for filtering|Required by Torii| |
| 107 | + |---|---|---|---| |
| 108 | + |userName|String|✓|✓ |
| 109 | + |active|Boolean|| |
| 110 | + |name.givenName|String|| |
| 111 | + |name.familyName|String|| |
| 112 | + |userType|String|| |
| 113 | + |
| 114 | + >[!NOTE] |
| 115 | + >* **userName** must be a valid email address with a valid domain. |
| 116 | + >* **userType**(role in Torii): |
| 117 | + > * It must be exactly as appear at Torii |
| 118 | + > * If **userType** is empty, the user will get the **Employee** role as the default. |
| 119 | + > * The user types(roles) appear [here](https://support.toriihq.com/hc/en-us/articles/6174005637787#h_01G6FRWNXDJG89HCBD93PNYW4H). |
| 120 | + > * Only admin users (not from type "Employee") will be displayed in Torii's UI |
| 121 | + >* Read more about Torii's attributes [here](https://support.toriihq.com/hc/en-us/articles/9183460072347-Torii-s-SCIM-User-Provisioning#heading-3). |
| 122 | + |
| 123 | +1. To configure scoping filters, refer to the following instructions provided in the [Scoping filter tutorial](../app-provisioning/define-conditional-rules-for-provisioning-user-accounts.md). |
| 124 | + |
| 125 | +1. To enable the Azure AD provisioning service for Torii, change the **Provisioning Status** to **On** in the **Settings** section. |
| 126 | + |
| 127 | +  |
| 128 | + |
| 129 | +1. Define the users that you would like to provision to Torii by choosing the desired values in **Scope** in the **Settings** section. |
| 130 | + |
| 131 | +  |
| 132 | + |
| 133 | +1. When you're ready to provision, click **Save**. |
| 134 | + |
| 135 | +  |
| 136 | + |
| 137 | +This operation starts the initial synchronization cycle of all users defined in **Scope** in the **Settings** section. The initial cycle takes longer to perform than subsequent cycles, which occur approximately every 40 minutes as long as the Azure AD provisioning service is running. |
| 138 | + |
| 139 | +## Step 6. Monitor your deployment |
| 140 | +Once you've configured provisioning, use the following resources to monitor your deployment: |
| 141 | + |
| 142 | +* Use the [provisioning logs](../reports-monitoring/concept-provisioning-logs.md) to determine which users have been provisioned successfully or unsuccessfully |
| 143 | +* Check the [progress bar](../app-provisioning/application-provisioning-when-will-provisioning-finish-specific-user.md) to see the status of the provisioning cycle and how close it's to completion |
| 144 | +* If the provisioning configuration seems to be in an unhealthy state, the application goes into quarantine. Learn more about quarantine states [here](../app-provisioning/application-provisioning-quarantine-status.md). |
| 145 | + |
| 146 | +## More resources |
| 147 | + |
| 148 | +* [Managing user account provisioning for Enterprise Apps](../app-provisioning/configure-automatic-user-provisioning-portal.md) |
| 149 | +* [What is application access and single sign-on with Azure Active Directory?](../manage-apps/what-is-single-sign-on.md) |
| 150 | + |
| 151 | +## Next steps |
| 152 | + |
| 153 | +* [Learn how to review logs and get reports on provisioning activity](../app-provisioning/check-status-user-account-provisioning.md) |
0 commit comments