Tutorial: Configure Slack for automatic user provisioning
Note
Integrating with Slack with a custom / BYOA application is not supported. Using the gallery application as described in this tutorial is supported. The gallery application has been customized to work with Slack's SCIM v1 server.
The objective of this tutorial is to show you the steps you need to perform in Slack and Microsoft Entra ID to automatically provision and de-provision user accounts from Microsoft Entra ID to Slack. 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 Slack
- Remove users in Slack when they do not require access anymore
- Keep user attributes synchronized between Microsoft Entra ID and Slack
- Provision groups and group memberships in Slack
- Single sign-on to Slack (recommended)
Prerequisites
The scenario outlined in this tutorial assumes that you already have the following items:
- A Microsoft Entra tenant.
- One of the following roles: Application Administrator, Cloud Application Administrator, or Application Owner.
- A Slack tenant with the Plus plan or better enabled.
- A user account in Slack with Team Admin permissions.
Note
This integration is also available to use from Microsoft Entra US Government Cloud environment. You can find this application in the Microsoft Entra US Government Cloud Application Gallery and configure it in the same way as you do from public cloud.
Step 1: Plan your provisioning deployment
- Learn about how the provisioning service works.
- Determine who will be in scope for provisioning.
- Determine what data to map between Microsoft Entra ID and Slack.
Step 2: Add Slack from the Microsoft Entra application gallery
Add Slack from the Microsoft Entra application gallery to start managing provisioning to Slack. If you have previously setup Slack 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 3: 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 4: Configure automatic user provisioning to Slack
This section guides you through connecting your Microsoft Entra ID to Slack's user account provisioning API, and configuring the provisioning service to create, update, and disable assigned user accounts in Slack based on user and group assignment in Microsoft Entra ID.
To configure automatic user account provisioning to Slack in Microsoft Entra ID:
Sign in to the Microsoft Entra admin center as at least a Cloud Application Administrator.
Browse to Identity > Applications > Enterprise applications
In the applications list, select Slack.
Select the Provisioning tab.
Set the Provisioning Mode to Automatic.
Under the Admin Credentials section, click Authorize. This opens a Slack authorization dialog in a new browser window.
In the new window, sign into Slack using your Team Admin account. in the resulting authorization dialog, select the Slack team that you want to enable provisioning for, and then select Authorize. Once completed, return to the Azure portal to complete the provisioning configuration.
Select Test Connection to ensure Microsoft Entra ID can connect to your Slack app. If the connection fails, ensure your Slack account has Team Admin permissions and try the "Authorize" step again.
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.
Select Save.
Under the Mappings section, select Synchronize Microsoft Entra users to Slack.
In the Attribute Mappings section, review the user attributes that will be synchronized from Microsoft Entra ID to Slack. Note that the attributes selected as Matching properties will be used to match the user accounts in Slack for update operations. Select the Save button to commit any changes.
Attribute | Type |
---|---|
active | Boolean |
externalId | String |
displayName | String |
name.familyName | String |
name.givenName | String |
title | String |
emails[type eq "work"].value | String |
userName | String |
nickName | String |
addresses[type eq "untyped"].streetAddress | String |
addresses[type eq "untyped"].locality | String |
addresses[type eq "untyped"].region | String |
addresses[type eq "untyped"].postalCode | String |
addresses[type eq "untyped"].country | String |
phoneNumbers[type eq "mobile"].value | String |
phoneNumbers[type eq "work"].value | String |
roles[primary eq "True"].value | String |
locale | String |
name.honorificPrefix | String |
photos[type eq "photo"].value | String |
profileUrl | String |
timezone | String |
userType | String |
preferredLanguage | String |
urn:scim:schemas:extension:enterprise:1.0.department | String |
urn:scim:schemas:extension:enterprise:1.0.manager | Reference |
urn:scim:schemas:extension:enterprise:1.0.employeeNumber | String |
urn:scim:schemas:extension:enterprise:1.0.costCenter | String |
urn:scim:schemas:extension:enterprise:1.0.organization | String |
urn:scim:schemas:extension:enterprise:1.0.division | String |
Under the Mappings section, select Synchronize Microsoft Entra groups to Slack.
In the Attribute Mappings section, review the group attributes that will be synchronized from Microsoft Entra ID to Slack. Note that the attributes selected as Matching properties will be used to match the groups in Slack for update operations. Select the Save button to commit any changes.
Attribute Type displayName String members Reference To configure scoping filters, refer to the following instructions provided in the Scoping filter tutorial.
To enable the Microsoft Entra provisioning service for Slack, change the Provisioning Status to On in the Settings section
Define the users and/or groups that you would like to provision to Slack by choosing the desired values in Scope in the Settings section.
When you are ready to provision, click Save.
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 5: Monitor your deployment
Once you've configured provisioning, use the following resources to monitor your deployment:
- Use the provisioning logs to determine which users have been provisioned successfully or unsuccessfully
- Check the progress bar to see the status of the provisioning cycle and how close it is to completion
- If the provisioning configuration seems to be in an unhealthy state, the application will go into quarantine. Learn more about quarantine states here.
Troubleshooting Tips
When configuring Slack's displayName attribute, be aware of the following behaviors:
Values are not entirely unique (such as 2 users can have the same display name)
Supports non-English characters, spaces, capitalization.
Allowed punctuation includes periods, underscores, hyphens, apostrophes, brackets (for example,
( [ { } ] )
), and separators (for example,, / ;
).displayName property cannot have an '@' character. If an '@' is included, you may find a skipped event in the provisioning logs with the description "AttributeValidationFailed."
Only updates if these two settings are configured in Slack's workplace/organization - Profile syncing is enabled and Users cannot change their display name.
Slack's userName attribute has to be under 21 characters and have a unique value.
Slack only allows matching with the attributes userName and email.
Common error codes are documented in the official Slack documentation - https://api.slack.com/scim#errors
Change log
- 06/16/2020 - Modified DisplayName attribute to only be updated during new user creation.
Additional Resources
- Managing user account provisioning for Enterprise Apps
- What is application access and single sign-on with Microsoft Entra ID?