# SCIM Provisioning using Azure Active Directory

The System for Cross-Domain Identity Management (SCIM) user management API enables automatic provisioning of users between the Code Ocean Platform and Azure Active Directory (AAD).

{% hint style="info" %}
Setting up Groups is the best way to ensure that new users will have all relevant Capsules, Data, and Pipelines available to them when they join, and that there will be no lost assets when team members leave.&#x20;

It is best practice to utilize Group sharing when working with shared assets.
{% endhint %}

## Requirements <a href="#jr1a6oj0j7c0" id="jr1a6oj0j7c0"></a>

* Cloud application administrator role or higher in Azure Active Directory
* An administrator in Code Ocean

## Creating a Custom Application <a href="#tiwtgoajwi1u" id="tiwtgoajwi1u"></a>

1. Login into your Microsoft Azure Portal and click **Azure Active Directory** in the left-hand portal menu. Alternatively, you can search for it in the top search bar
2. Once inside your AAD Tenant, find and click **Enterprise applications** in the left-hand menu

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FA2E1cS7PKrTk0MQen4H9%2FAzure%20Active%20Directory%20-%20Microsoft%20Azure%202021-10-17%20at%203.28.31%20PM.jpg?alt=media\&token=243bb3d5-8f03-4028-a5f4-58e6188598c3)

3\. Click **New Application**, then **Create your own application**. In the menu that appears, fill out a name for the app to integrate and leave the bubble selected for **Integrate any other application you don't find in the gallery (Non-gallery)**

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FuePVtX4ER36yMBWUB7Sr%2F1?alt=media)

{% hint style="warning" %}
It may take a few minutes for the application to be deployed. The status can be monitored under the Notifications dropdown on the top ribbon.
{% endhint %}

4\. Once the deployment is finished click **Enterprise applications link** beneath the search bar to find your newly created application

## Configuring Provisioning <a href="#udpth13w1q8f" id="udpth13w1q8f"></a>

### Get the Code Ocean SCIM Provisioning Information (URL and token) <a href="#z0a1k2t9txh8" id="z0a1k2t9txh8"></a>

1. Go to the Code Ocean Admin Panel
2. Click **Integrations**
3. Scroll down to the SCIM section and copy the Provisioning URL and save it for a later stage

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FaQD0hf5TPwr9pV4uGTzr%2F2?alt=media)

4\. Click **Generate new token**, copy the token and save it for a later stage

### &#x20;<a href="#jl0lk3a34t17" id="jl0lk3a34t17"></a>

### Configuring Provisioning in Azure AD <a href="#dpvcvnek5npm" id="dpvcvnek5npm"></a>

1. Click **Provisioning**, then **Get Started**

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2Fh0QlhAVXt81EvmyEO7Ro%2F3?alt=media)

2\. Use the dropdown box to select **Automatic** (1), enter the **Tenant URL** of the Provisioning URL copied from Code Ocean and your Provisioning Token (2, 3)

3\. Click **Test Connection** and observe the successful test (4)

4\. Click **Save** (5)

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FeZIF8IS3BfgeIJwgdKUf%2F4?alt=media)

{% hint style="info" %}
Provisioning sync is done every 40 minutes. See more information [here](https://docs.microsoft.com/en-us/azure/active-directory/app-provisioning/application-provisioning-when-will-provisioning-finish-specific-user).&#x20;
{% endhint %}

## Assigning Users & Groups <a href="#a8hlg4s0py6h" id="a8hlg4s0py6h"></a>

### Set Up User Provisioning <a href="#j1rea7djvs60" id="j1rea7djvs60"></a>

1. Go back to the application main page
2. Navigate to **Users and groups**
3. Click **Add user/group**

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FnlaR4wAGqEyWFklWqhvn%2F5?alt=media)

3\. Click **Users and groups** from the list in None Selected

4\. Search for users/groups and select them from the list

5\.  Click **Select**&#x20;

6\. Click **Assign**&#x20;

![mceclip14.png](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2Fwlc7ev7OIGbTHzKhTWLZ%2F7?alt=media)

### User Attributes <a href="#n4cgvt2fcjq" id="n4cgvt2fcjq"></a>

These fields are supported for mapping user attributes:

* Name (first and last name)
* Email (must be lowercase)
* Active (whether or not a user is enabled or disabled)

{% hint style="warning" %}
Logging in to Code Ocean requires an email address. To sync users to Code Ocean, users in AD must have their email addresses included in their profiles.
{% endhint %}

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2Ft66riOXz7yEGKyUm5f5x%2F8?alt=media)<br>

### Set-Up Group Provisioning <a href="#sshl182hr9a7" id="sshl182hr9a7"></a>

You can provision groups from Azure AD to Code Ocean by assigning a group to the codeocean-scim application. This will create a new group in your Code Ocean account with all the users that are assigned to that group in Azure AD.

1. Go to the application main page
2. Navigate to **Users and groups**
3. Click **Add user/group**

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FJoRMRIqrEjVh3E7U7B8s%2F9?alt=media)

![](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2FiL2F5CFjr246eX1nKacd%2F10?alt=media)

4\. Search for a group and select it from the list,

5\. Click **Select**&#x20;

6\. Click **Assign**

![mceclip15.png](https://3068427076-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FzNNpqe0BZizzgqiYcyO0%2Fuploads%2F0OZhm19IzdWpjLcDwti5%2F11?alt=media)
