Tutorial: Configure Twingate for automatic user provisioning

This tutorial describes the steps you need to perform in both Twingate and Microsoft Entra ID to configure automatic user provisioning. When configured, Microsoft Entra ID automatically provisions and de-provisions users and groups to Twingate using the Microsoft Entra 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 Microsoft Entra ID.

Capabilities Supported

  • Create users in Twingate
  • Remove users in Twingate when they do not require access anymore
  • Keep user attributes synchronized between Microsoft Entra ID and Twingate
  • Provision groups and group memberships in Twingate
  • Single sign-on to Twingate (recommended)

Prerequisites

The scenario outlined in this tutorial assumes that you already have the following prerequisites:

Step 1: Plan your provisioning deployment

  1. Learn about how the provisioning service works.
  2. Determine who will be in scope for provisioning.
  3. Determine what data to map between Microsoft Entra ID and Twingate.

Step 2: Configure Twingate to support provisioning with Microsoft Entra ID

  1. Sign in to your Twingate Admin Console.

  2. Navigate to Settings > Identity Provider

  3. Click on the ... button to open the action menu. Select Regenerate SCIM Token. Note that this would invalidate your existing token if any.

    Screenshot of Microsoft Entra action menu.

  4. Copy the SCIM Endpoint and SCIM token from the modal. These values will be entered in the Tenant URL and Secret Token fields respectively in the Provisioning tab of your Twingate application.

    Screenshot of SCIM info modal.

Add Twingate from the Microsoft Entra application gallery to start managing provisioning to Twingate. If you have previously setup Twingate for SSO, you can use the same application. However it is recommended that you create a separate app when testing out the integration initially. Learn more about adding an application from the gallery here.

Step 4: Define who will be in scope for provisioning

The Microsoft Entra provisioning service allows you to scope who will be provisioned based on assignment to the application and or based on attributes of the user / group. If you choose to scope who will be provisioned to your app based on assignment, you can use the following steps to assign users and groups 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.

  • Start small. Test with a small set of users and groups before rolling out to everyone. When scope for provisioning is set to assigned users and groups, you can control this by assigning one or two users or groups to the app. When scope is set to all users and groups, you can specify an attribute based scoping filter.

  • If you need additional roles, you can update the application manifest to add new roles.

Step 5: Configure automatic user provisioning to Twingate

This section guides you through the steps to configure the Microsoft Entra provisioning service to create, update, and disable users and/or groups in Twingate based on user and/or group assignments in Microsoft Entra ID.

To configure automatic user provisioning for Twingate in Microsoft Entra ID:

  1. Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.

  2. Browse to Identity > Applications > Enterprise applications

    Screenshot of Enterprise applications blade.

  3. In the applications list, select Twingate.

    Screenshot of The Twingate link in the Applications list.

  4. Select the Provisioning tab.

    Screenshot of Provisioning tab.

  5. Set the Provisioning Mode to Automatic.

    Screenshot of Provisioning tab automatic.

  6. Under the Admin Credentials section, input your Twingate Tenant URL and Secret Token. Click Test Connection to ensure Microsoft Entra ID can connect to Twingate. If the connection fails, ensure your Twingate account has Admin permissions and try again.

    Token

  7. 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.

    Screenshot of Notification Email.

  8. Select Save.

  9. Under the Mappings section, select Synchronize Microsoft Entra users to Twingate.

  10. Review the user attributes that are synchronized from Microsoft Entra ID to Twingate in the Attribute-Mapping section. The attributes selected as Matching properties are used to match the user accounts in Twingate for update operations. If you choose to change the matching target attribute, you will need to ensure that the Twingate API supports filtering users based on that attribute. Select the Save button to commit any changes.

    Attribute Type Supported For Filtering
    externalId String
    userName String
    active Boolean
    emails[type eq "work"].value String
    name.givenName String
    name.familyName String
  11. Under the Mappings section, select Synchronize Microsoft Entra groups to Twingate.

  12. Review the group attributes that are synchronized from Microsoft Entra ID to Twingate in the Attribute-Mapping section. The attributes selected as Matching properties are used to match the groups in Twingate for update operations. Select the Save button to commit any changes.

    Attribute Type Supported For Filtering
    externalId String
    displayName String
    members Reference
  13. To configure scoping filters, refer to the following instructions provided in the Scoping filter tutorial.

  14. To enable the Microsoft Entra provisioning service for Twingate, change the Provisioning Status to On in the Settings section.

    Screenshot of Provisioning Status Toggled On.

  15. Define the users and/or groups that you would like to provision to Twingate by choosing the desired values in Scope in the Settings section.

    Screenshot of Provisioning Scope.

  16. When you are ready to provision, click Save.

    Screenshot of Saving Provisioning Configuration.

This operation starts the initial synchronization cycle of all users and groups 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 Microsoft Entra provisioning service is running.

Step 6: Change Assignment required setting

The default setting is No which allows users to log into Twingate without being assigned in the enterprise application.

  1. Click on Properties.

    Screenshot of Properties.

  2. Set Assignment required to Yes

    Screenshot of Properties assignment.

  3. Click on Save

    Screenshot of Properties saved.

Step 7: Monitor your deployment

Once you've configured provisioning, use the following resources to monitor your deployment:

  1. Use the provisioning logs to determine which users have been provisioned successfully or unsuccessfully
  2. Check the progress bar to see the status of the provisioning cycle and how close it is to completion
  3. If the provisioning configuration seems to be in an unhealthy state, the application will go into quarantine. Learn more about quarantine states here.

Additional resources

Next steps