# Microsoft Azure SSO Login

**SSO** feature requires a whitelist for activation and is intended for enterprise clients.

::: tip Note
To activate this feature, please get in touch with the relevant sales representative or customer success manager (sales@d5techs.com), and provide the team owner's account.
:::

## Microsoft Azure SSO (SAML) Setup Guide

### Prerequisites

- The user must have a **Microsoft Azure account** for their company.
- After logging in, go to the **"Enterprise Applications"** page.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/P3iv2oNcrbjgHRl5WysH/image.png)

---

### Create an Application

1. Click **"Create your own application"**.

2. Give your application a name.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/4N3d44XeoeZQ6A4yB7Rr/image.png)

3. Choose **"Set up single sign-on"** and select **SAML** as the login method.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/VaFmaBbpns2B4nt9I294/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/C3wdk1Ht7jb2tRIxkvDf/image.png)

---

### Permission Requirements

- Only **Team Owners** or **Super Team Admins** have access to the SSO configuration page.

---

## D5-Myspace SSO Configuration

### Enable SSO

- SSO is **disabled by default**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/QjrxO4q7FlhHpvdzEhLG/image.png)

### Configuration Item Details

#### Identity Provider (IdP)

- Currently, **only Microsoft Entra** is supported.

#### SSO Protocol

- Currently, only **SAML** is supported.

#### Login Method Options

There are **two options** for how users log in:

1. **Single Sign-On (SSO) & Username/Password** (default) — Users can log in using either SSO or their account credentials.
2. **SSO Only** — Users can only log in via Single Sign-On; password login will be disabled.

#### Add Domain(s)

- Enter **your company email suffixes** (e.g., **yourcompany.com**).
- **Multiple domains** can be added.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/iNnjhX0Xl7hVaNuASDm9/image.png)

#### Service Provider (SP) Configuration

**Recommended method:**

1. Download the XML file from the D5 Team Management backend.
2. In the Azure portal, open the SSO configuration module and go to **"Set up Single Sign-On"**.
3. Click **"Upload metadata file"** and import the downloaded XML file.

**Manual method:**

1. In Azure's "Basic SAML Configuration" section, manually fill in the following:
   - Copy the **Identifier (Entity ID)** from the D5 backend and paste it into the corresponding field.
   - Copy the **Assertion Consumer Service URL (ACS URL)** and paste it accordingly.
2. Click **"Save"** to apply.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/rIigU3QRCCu9lECjlcQn/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/q3LxaJZU7FhvX5OXk8mh/image.png)

#### Identity Provider (IdP) Information

1. In the Azure portal's SSO module, go to the **"Set up Single Sign-On"** section.
2. Under the **SAML Certificates** area, download the **"Federation Metadata XML"**.
3. Upload this file to the D5 Team Management backend.
4. The system will parse the content and automatically fill in the IdP login URL.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/mF9aApPD483ekUzeJsPW/image.png)

---

## Microsoft Azure SCIM Configuration Guide

### Setup in D5 Myspace — Team Management Backend

<figure class="doc-image doc-image--stack">
  <img src="https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/aRq9GbbBBhPMUk4AS7ow/image.png" alt="Enable Provisioning" />
  <figcaption>Enable Provisioning</figcaption>
</figure>

---

### Setup in Microsoft Azure

1. Go to **Enterprise Applications** → **SSO Control Module** → **Provisioning**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/I8XHvFmf0eoiBEqh84Gz/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/nLxXKS0pJSZPVGNyf7U9/image.png)

2. Click **Add a new configuration**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/O1tfLhN63YhE4X8SzuTb/image.png)

3. Enter the **SCIM endpoint and access token** provided in the D5 Team Management Backend. Click **Test Connection**, and after the test is successful, click **Create**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/eR6B7UJ059Q0QoFB1d5n/image.png)

4. Click **Settings**, enable the provisioning switch, and click **Save**.

::: tip Note
If the access token changes in the future:

- Navigate to **Provisioning** → **Settings**→**Admin Credentials**
- Set the **Provisioning Status** to  On **
- Click **Save**
- Finally, **enable provisioning** to sync user accounts
:::

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/AJvZoO3LG1COk1gw19vk/image.png)

5. Click **Mappings**, then select **Provision Microsoft Entra ID Users**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/vEDMoIMWEVqbT0jmFHeD/image.png)

6. On the attribute mapping page, click **Add New Mapping**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/SZ0nZZkIFsjNDlIqjX6t/image.png)

7. Configure the new mapping with the following steps. After completing the configuration, click **Save**:

   - Set **Mapping type** to **Expression**
   - Enter the following **Expression:** `SingleAppRoleAssignment([appRoleAssignments])`
   - Set **Target attribute** to `roles[primary eq "True"].value`
   - Set **Match objects using this attribute** to **Yes**
   - Set **Matching precedence** to **2**

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/FKVAk3WEhgxwAEyLaCG4/image.png)

8. Return to the attribute mapping page and click **Save**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/F9tlmeHboP0PguTtsJ8y/image.png)

9. Return to the **Overview (Preview)** page to confirm whether provisioning has started. If it hasn't, click **Start Provisioning**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/S8JHDBhqOt6WUjVsTfLt/image.png)

---

### Creating Application Roles

1. Go to **Enterprise Applications** → **SSO Control Module** → **Properties**.
2. Click **"App Registrations"**.
3. After entering, go to the **"App Roles"** section.
4. You can **add new roles** here as needed.

::: warning Important
If no roles are configured, synced users will default to **Team Member** role.
:::

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/SlhLZSTBXaR3c3imrm3a/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/jXVLVmJgPhebfb1Z97QW/image.png)

---

### Start Provisioning

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/Xe3DPYsmPC8otuwzSeAo/image.png)

### SCIM Sync Behavior

When **SCIM is enabled**, the following features will be **disabled** in the D5 Team Management Backend:

- Manually **editing team member roles**
- **Modifying member account attributes**
- **Inviting users to the team**

-**Removing members from the team**

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/VvazWYc1OpA8dIYZl3eD/image.png)

In **Group Management**, the following options will also be hidden:

- **Invite to Team**

-**Remove from Team**

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/8PCl09RMVgllLFc0Jokx/image.png)

#### Sync Status and Frequency

- **Sync Frequency:** Once every **40 minutes**

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/cnYr6tT1kyiNaenNuzxP/image.png)

**View Sync Results:**

- In the Azure backend, click on sync logs.
- You can see **each step of the sync** and any **failure reasons**.

<figure class="doc-image doc-image--stack">
  <img src="https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/JA32YpviiN4JOmUXQWCf/image.png" alt="Example Case" />
  <figcaption>Example Case</figcaption>
</figure>

- A new user is added in the IdP (who has **never registered** in D5).
- After waiting for the sync cycle, the user will automatically appear in the team.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/Fnuuft3EXlRw4SNmCidQ/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/g21RqS7zzaASaSP66xbY/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/PYc8RZ4yg28AIrtUSHiQ/image.png)

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/vjRfbR0nWrq1WPJJ2IAV/image.png)

---

### Sync Failure Scenarios

#### Team Seat Limit Reached

If an existing D5 account is being synced while the team's seat quota is full, the sync will fail, and the account will **not be added to the team**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/h6IFNBUKnPOlVRv07fVr/image.png)

#### Backend Deployment in Progress

If the D5 backend is undergoing a release during the sync process, the sync will fail.

The account will **not be created nor added to the team.

**It will be retried in the** next scheduled sync**.

![image](https://docs-static.d5render.com/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces/-MjbN1iGmN_HBnj_fyU9/uploads/qp7kKRqS6a6D48wps3BB/image.png)
