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

## 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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2FIkIYY4gt3QdJVvbtA6Tj%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2FziZ4NGlnKwqovdXjTrnB%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2F1v8QBC13y8EtAMlArGpq%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2Ffu3Z2UqRSHwS40j2nsJw%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2F8JlMTVrTK38bmETAKhFc%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2FlBWpdKlNZjMfHx0X2jtd%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2FdHIsk0FjY5ym5XmJVCaB%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2Fr0b39ITbquPxhVziZ5P4%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://817378851-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk6QoUOr1tXhxQWXO2SRU%2Fuploads%2F5bGPGJMhfBvXbyEyhVKx%2F9?alt=media)

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

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

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

6\. Click **Assign**

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