> ## Documentation Index
> Fetch the complete documentation index at: https://dub.co/llms.txt
> Use this file to discover all available pages before exploring further.

# Configuring SAML SSO with Azure AD

> For Dub Enterprise users, you can securely manage your team's access to Dub using Azure AD SAML SSO.

<Tip>
  This feature is only available on [Dub Enterprise](https://dub.co/enterprise).
</Tip>

For Dub Enterprise users, you can securely manage your team's access to Dub using [Azure AD SAML SSO](https://learn.microsoft.com/en-us/azure/active-directory/architecture/auth-saml).

## Step 1: Create or Select SAML Application

In your [Azure Admin console](https://portal.azure.com/), select **Azure Active Directory** (or search for it in the search bar).

<Frame>
  <img src="https://assets.dub.co/help/azure-ad.png" alt="Azure Active Directory option on the Azure Dashboard" />
</Frame>

Then, click on **Enterprise applications** from the left sidebar.

<Frame>
  <img src="https://assets.dub.co/help/azure-ent-apps.png" alt="Enterprise applications option on the Azure Dashboard" />
</Frame>

If you already have an existing Azure AD SAML application, select it from the list and move on to [Step 2](#step-2-configure-saml-applicaation).

If not, click on **New application** at the top.

<Frame>
  <img src="https://assets.dub.co/help/azure-new-app.png" alt="Create new application button on the Azure Dashboard" />
</Frame>

In the next screen, click on **Create your own application**. Give your application a **Name** (e.g. "Dub") and click **Create**.

<Frame>
  <img src="https://assets.dub.co/help/azure-create-own.png" alt="Create your own application option on the Azure Dashboard" />
</Frame>

## Step 2: Configure SAML Application

Under the **Manage** section in the left sidebar, select **Single sign-on**. Then, click on **SAML**.

<Frame>
  <img src="https://assets.dub.co/help/azure-saml.png" alt="SAML option on the Azure Dashboard" />
</Frame>

Under the **Basic SAML Configuration** section, click on **Edit**.

<Frame>
  <img src="https://assets.dub.co/help/azure-saml-edit.png" alt="Edit button on the SAML Settings page on the Azure Dashboard" />
</Frame>

This will open up a sheet overlay. Under **Basic SAML Configuration**, enter the following values:

```text title="Identifier (Entity ID)" theme={null}
https://saml.dub.co
```

```text title="Reply URL (Assertion Consumer Service URL)" theme={null}
https://api.dub.co/auth/saml/callback
```

<Frame>
  <img src="https://assets.dub.co/help/azure-basic-saml.png" alt="Basic SAML Configuration section on the Azure Dashboard" />
</Frame>

Click **Save** in the menu bar to save your changes.

<Frame>
  <img src="https://assets.dub.co/help/azure-save-saml.png" alt="Basic SAML Configuration section on the Azure Dashboard" />
</Frame>

## Step 3: Attribute Mapping

Click **Edit** on the **Attributes & Claims** section.

<Frame>
  <img src="https://assets.dub.co/help/azure-attributes.png" alt="Attributes & Claims section on the Azure Dashboard" />
</Frame>

Under **Additional claims**, make sure the following entries are present:

| Name                                                                                                                                     | Value                  |
| ---------------------------------------------------------------------------------------------------------------------------------------- | ---------------------- |
| [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress) | user.mail              |
| [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname)       | user.givenname         |
| [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name)                 | user.userprincipalname |
| [http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname](http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname)           | user.surname           |

<Frame>
  <img src="https://assets.dub.co/help/azure-attributes-claims.png" alt="Additional claims section on the Azure Dashboard" />
</Frame>

Once that's done, click on the `X` button in the top right corner to go back to the main settings page (or click the back button in your browser).

## Step 4: Copy the Metadata URL

Scroll down to the 3rd section on the page, **SAML Certificates**. Copy the **App Federation Metadata Url** value and return to the Dub dashboard.

<Frame>
  <img src="https://assets.dub.co/help/azure-metadata-url.png" alt="Metadata URL on the Azure Dashboard" />
</Frame>

## Step 5: Configure SAML SSO on Dub

In your workspace settings, click on **Security** in the **Workspace** group.

<Frame>
  <img src="https://assets.dub.co/cms/saml-directory-sync-2.png" alt="Directory Sync section on the Dub Dashboard" />
</Frame>

Under the **SAML Single Sign-On** section, click on **Configure**. This will open up the SAML SSO modal:

1. Select **Azure AD** as the SAML provider.
2. Enter the **App Federation Metadata Url** value that you copied from Step 4.
3. Click **Save changes**.

<Frame>
  <img src="https://assets.dub.co/cms/saml-entra.png" alt="SAML SSO Modal" />
</Frame>

## Step 6: Assign Users

<Warning>
  We highly recommend configuring [SCIM Directory
  Sync](/help/article/azure-scim) before assigning users & groups to your
  workspace. This will ensure that your users are automatically added to your
  workspace when they sign in for the first time, as well as automatically
  removed when they are deactivated in Azure.
</Warning>

Once you've configured SAML SSO, you can start assigning users & groups to your workspace.

From your application, click the **Users and groups** from the left navigation menu and click **Add user/group**.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-add-users.png" alt="Adding users in Azure AD" />
</Frame>

Click on **None Selected** under **Users**.

From the right side of the screen, select the users you want to assign to the app and click the **Select** button. Thenm click **Assign** to those users to your app.

<Frame>
  <img src="https://assets.dub.co/help/azure-scim-assign-user.png" alt="Assigning users in Azure AD" />
</Frame>

Your assigned users should now receive an invitation email to join your Dub workspace.

<Frame>
  <img src="https://assets.dub.co/help/saml-invite.png" alt="SAML invite email" />
</Frame>

<Warning>
  Azure AD SCIM provisioning can take [anywhere between 20-40 minutes to
  sync](https://learn.microsoft.com/en-us/azure/databricks/administration-guide/users-groups/scim/aad#provisioning-tips).
  This means that it may take up to 40 minutes for your users to receive the
  invitation email and be able to join your Dub workspace.
</Warning>

They will also be able to sign in to Dub using Azure AD SSO.
