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

# Microsoft Azure SSO

> Configure single-sign-on (SSO) to Minimus via Azure

Add single-sign-on (SSO) to Minimus in Azure, by configuring Minimus as a custom SAML app.

## Prepare the SSO form in Minimus

1. Go to **Manage** > **Users & Groups** ([direct link](https://images.minimus.io/manage/access/users?saml=open))
2. Click **Configure SSO** at the top of the page to open the Minimus SSO form.
   <Tip>
     Keep this form open and available in another browser tab as you configure the SAML app in Azure.
   </Tip>
3. The form has 4 parts:
   1. **Configure Minimus as a custom app in your identity provider** - You will copy these parameters from Minimus to Azure in the next steps.
      1. SP Entity ID
      2. Reply URL (Callback / ACS URL)
      3. Relay State (optional) - If you leave the Relay State blank, users will only be able to login with SSO from the Minimus homepage.
   2. **Connect Minimus to your identity provider** - You will fetch these parameters from your Azure custom app and save them to the Minimus form:
      1. Login SSO URL
      2. IdP Entity ID
      3. Certificate
   3. **SAML Attribute Mapping** - You will the fetch the Azure claim names for the following parameters and save them to the Minimus form:
      | Minimus Parameter | Azure Attribute Name   |
      | :---------------- | :--------------------- |
      | Email             | user.mail              |
      | Full Name         | user.userprincipalname |
   4. **Group Mapping** is optional and can be enabled if you plan to configure user groups. [See the instructions in user groups](/manage/user-groups).

## Add Minimus as a custom app under Azure Enterprise Applications

<Steps>
  <Step title="Create a Minimus application in Azure">
    1. The first step is to create the Minimus App in Azure and link it to your Minimus Console. Go to **Enterprise Applications** to begin.
    2. Select the option **New application**.
    3. In the top bar, select the option to **Create your own application**.
       1. Name the application. (We'll assume the name **Minimus App** was used for the rest of this guide.)
       2. Select the option to **Integrate any other application you don't find in the gallery (Non-gallery)**.
       3. Click **Create**.
       4. Wait for the success confirmation. It may take a minute or so.
  </Step>

  <Step title="Configure the SAML app">
    1. Select **Set up single sign on**.
           <Frame>
             <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-set-up-sso.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=848717d5cbc4e249a8cb8013587bcc9e" alt="Azure Set Up Sso" width="1390" height="1044" data-path="images/azure-set-up-sso.png" />
           </Frame>
    2. Select **SAML**.
           <Frame>
             <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/images/azure-select-saml.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=404ec3a080ced96b5bca033bdb1507ec" alt="Azure Select Saml" width="1425" height="930" data-path="images/azure-select-saml.png" />
           </Frame>

    This will open the form **Set up Single Sign-On with SAML**. The form includes numbered steps.

    1. Select **Edit** for **Step 1** - **Basic SAML Configuration**.
           <Frame>
             <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/images/azure-edit-single-sign-on.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=a302b69024d0b4303fd2ae2bbc07c7ad" alt="Azure Edit Single Sign On" width="1425" height="976" data-path="images/azure-edit-single-sign-on.png" />
           </Frame>
    2. Copy the following from the Minimus SSO form to Azure:

    | To copy from Minimus form      | And paste in Azure form                    |
    | :----------------------------- | :----------------------------------------- |
    | SP Entity ID                   | Identifier (Entity ID)                     |
    | Reply URL (Callback / ACS URL) | Reply URL (Assertion Consumer Service URL) |
    | Relay State                    | Relay State (Optional)                     |

    3. **Save** the form.

    <Frame>
      <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/azure-reply-url.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=ca51a4d944a53e74f0560d9749db1f40" alt="Azure Reply Url" width="1425" height="991" data-path="azure-reply-url.png" />
    </Frame>
  </Step>

  <Step title="Copy Microsoft Entra Identifier">
    1. You will be automatically navigated to the **Minimus App** overview page.
    2. Copy the Azure **Microsoft Entra Identifier** to the **IdP Entity ID** in the Minimus form.

    <Frame>
      <img src="https://mintcdn.com/gutsy-6162adbc/M16koopFr_47pyul/images/azure-entity-id-1.png?fit=max&auto=format&n=M16koopFr_47pyul&q=85&s=5f9ba396340b0fd450eecd4d22de2abf" alt="Azure Entity Id 1" width="783" height="1067" data-path="images/azure-entity-id-1.png" />
    </Frame>
  </Step>

  <Step title="Copy Azure attributes & claims to Minimus ">
    Copy the relevant schema to the SAML Attribute Mapping section in the Minimus SSO form as shown below.

    1. Select **Edit** for **Step 2** - **Attributes & Claims**.
           <Frame>
             <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/azure-step-2-entities-claims.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=9c9993af5a5dc86d88e527f989aca7aa" alt="Azure Step 2 Entities Claims" width="1425" height="1006" data-path="azure-step-2-entities-claims.png" />
           </Frame>
    2. You will see a table of the default claims.
    3. Copy the claim name for the `user.mail` and the `user.userprincipalname` to the Minimus form.

    | Minimus Parameter | Azure Attribute Name   |
    | ----------------- | :--------------------- |
    | Email             | user.mail              |
    | Full Name         | user.userprincipalname |

    <Frame>
      <img src="https://mintcdn.com/gutsy-6162adbc/Fs5fzSNJF4a-M8di/images/azure-claims-name.png?fit=max&auto=format&n=Fs5fzSNJF4a-M8di&q=85&s=6f94cd50b3a8c8f03de669f72e9ae5bd" alt="Azure Claims Name" width="1103" height="742" data-path="images/azure-claims-name.png" />
    </Frame>
  </Step>

  <Step title="Download Base64 Certificate">
    1. In Azure, continue to **Step 3 - SAML Certificates**.
    2. Download the **Base64 Certificate**.
    3. Open the certificate in notepad or another code viewer, and copy the code (including "-----BEGIN CERTIFICATE... and ...END CERTIFICATE-----").
    4. Copy the certificate to the Minimus SSO form.

    <Frame>
      <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/azure-download-certificate.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=cb1cc1b571ddbbb22ab631434e2e269a" alt="Azure Download Certificate" width="1425" height="952" data-path="azure-download-certificate.png" />
    </Frame>
  </Step>

  <Step title="Copy Azure Login URL to Minimus">
    1. In Azure, continue to **Step 4 - Set up Minimus**.
    2. Copy the Azure **Login URL** to the field **Login SSO URL** in the Minimus SSO form.
           <Frame>
             <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/images/azure-login-url.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=fc767e831a8d4f5ddb30f9b3c9df100c" alt="Azure Login Url" width="1382" height="1008" data-path="images/azure-login-url.png" />
           </Frame>
  </Step>

  <Step title="Enable group mapping, if relevant ">
    * If you aren't interested in group mapping, skip to the next step and save the SSO configuration form in Minimus. You are ready to [add SSO users in Minimus](/manage/users).  
    * If you want to add group mapping, follow the steps below. You have the option to either manage Azure groups by group name or group ID. The configurations are different for each. 
  </Step>

  <Step title="Save the Minimus SSO form" />
</Steps>

## Assign user/group access in Azure

Grant Azure users and/or groups access to Minimus.

1. In Azure, select **Enterprise Applications**.
2. Select your **Minimus App** to open its details.
3. Select **Users and Groups** from the left menu.
4. Select **Add user/group** and follow the instructions on the page.

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/FM7VH7b6fP7agbL4/images/azure-add-users.png?fit=max&auto=format&n=FM7VH7b6fP7agbL4&q=85&s=15520bf7b941e02fe579a2e6e51c2f23" alt="Azure Add Users" width="1425" height="771" data-path="images/azure-add-users.png" />
</Frame>

## Manage Azure group names in Minimus

The process involves a few extra steps if you plan to manage Azure group names in Minimus.

<Tip>
  These steps are not relevant if you intend to manage Azure groups by *group ID.*  Skip these steps if you plan to manage direct user access or Azure group IDs.
</Tip>

### Enable group mapping in Minimus

1. Open the Minimus SSO form ([direct link](https://images.minimus.io/manage/access/users?saml=open))
2. Enable **Step 4: Group Mapping**.
3. Select: **Azure**
4. Fill out the following Azure parameters:
   * **Application ID** (also shown as **Application (client) ID** depending on where you look it up in Azure)
   * **Client Secret** (see the next steps)
5. Save the Minimus SSO form.

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/minimus-form-azure-groups.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=76d20889326a2936b3202ebbeba1cf51" alt="Minimus Form Azure Groups" width="1696" height="922" data-path="images/minimus-form-azure-groups.png" />
</Frame>

### Configure API permissions

1. In Azure, search for **App Registrations**.
2. Select the enterprise application you created in the previous steps. (We assume you named it **Minimus App**).
3. Authorize your app to call APIs:
   <Frame>
     <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-api-permissions.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=48bf91d6099dd9d245489db20c49fee7" alt="Azure API Permissions" width="2560" height="1229" data-path="images/azure-api-permissions.png" />
   </Frame>
   1. Select **API Permissions** from the left menu.
   2. Select **Add a permission.**
   3. Select **Microsoft Graph** (It will be the top option under the default tab, **Microsoft APIs**).
   4. Select **Application permissions.**
   5. Search for "directory" and select **Directory.Read.All.**
   6. Click **add permissions** to save your changes.
4. In the same window, select **grant admin consent for Default Directory** and confirm your selection.
   <Frame>
     <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-grant-admin-consent.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=082325287cfd308a5b70cc1ab217ba03" alt="Azure Grant Admin Consent" width="1863" height="1003" data-path="images/azure-grant-admin-consent.png" />
   </Frame>

### Generate client secret

You will need to generate a client secret and save it in the Minimus SSO form.

1. In Azure, search for **App Registrations**.
2. Select the enterprise application you created in the previous steps. (We assume you named it **Minimus App**).
3. Select **certificates & secrets** from the left menu.
4. Select **+ New client secret**.
5. Set the secret's expiration, add a description (optional), and save the secret.
6. Copy the secret's value and save it immediately in the Minimus SSO form.

<Warning>
  Once the page is refreshed the value will no longer be retrievable. If needed, you can always create a new client secret.
</Warning>

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-add-client-secret.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=664ec5356f9018c27b369ff15b6f0ca0" alt="Azure Add Client Secret" width="1311" height="713" data-path="images/azure-add-client-secret.png" />
</Frame>

### Add Azure group names in Minimus

1. In Azure, look up your Azure groups. You can search for "groups" in the top searchbar.
   <Frame>
     <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-group-names.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=46b1450227ca62837f59ad1ffc2490fe" alt="Azure Group Names" width="1828" height="983" data-path="images/azure-group-names.png" />
   </Frame>
2. In the Minimus Groups form ([direct link](https://images.minimus.io/manage/access/groups)), add the groups by group name.

## Manage Azure group IDs in Minimus

The process involves a few extra steps if you plan to manage Azure group IDs in Minimus.

<Tip>
  These steps are not relevant if you intend to manage Azure groups by *group name.*  Skip these steps if you plan to manage direct user access or Azure group names.
</Tip>

### Add group claim

1. In Azure, search for **Enterprise Applications**
2. Select your app
3. Select  **single sign on** from the left menu
4. Select **edit** in **attributes & claims**

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-attributes-claims-1.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=f6e925a3dba7a30027ad656daea6e182" alt="Azure Attributes Claims 1" width="1863" height="1002" data-path="images/azure-attributes-claims-1.png" />
</Frame>

5. Select **add a group claim**. A form will appear to the right:
   1. Select the relevant groups. You can select **all groups** or another option. There are advanced options as well to filter out specific groups, etc.
   2. Save your group claim.

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-add-group-claim.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=c3bdb072b04748c1475652038412712a" alt="Azure Add Group Claim" width="1863" height="1002" data-path="images/azure-add-group-claim.png" />
</Frame>

6. The new group claim will be added to the list. Its format is fixed: `http://schemas.microsoft.com/ws/2008/06/identity/claims/groups`

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-group-claim-name.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=d4e9c85ae94d8bca4846a5f715c2125c" alt="Azure Group Claim Name" width="1863" height="758" data-path="images/azure-group-claim-name.png" />
</Frame>

### Enable group mapping in Minimus

1. Open the Minimus SSO form ([direct link](https://images.minimus.io/manage/access/users?saml=open))
2. Enable **Step 4: Group Mapping**.
3. Keep the default selection: **Google / Okta / Other**
4. Paste in the Azure group mapping:
   ```shellscript theme={null}
   http://schemas.xmlsoap.org/ws/2008/06/identity/claims/groups
   ```
5. Save the Minimus SSO form.

<Frame>
  <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-groups-enabled.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=f7257e6bb2645b1d76bde884dafaee87" alt="Azure Groups Enabled" width="1920" height="989" data-path="images/azure-groups-enabled.png" />
</Frame>

### Add Azure group IDs in Minimus

1. In Azure, look up your Azure groups. You can search for "groups" in the top searchbar.
   <Frame>
     <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-groups-ids.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=52f904a0d2fef95fa22c65f8e66063e6" alt="Azure Groups Ids" width="1828" height="983" data-path="images/azure-groups-ids.png" />
   </Frame>
2. In the Minimus Groups form ([direct link](https://images.minimus.io/manage/access/groups)), add the groups by Azure group ID.
   <Frame>
     <img src="https://mintcdn.com/gutsy-6162adbc/Z11rzI8zeyejtURU/images/azure-group-ids.png?fit=max&auto=format&n=Z11rzI8zeyejtURU&q=85&s=4a07d905180620cd6c647b465e9f6d4d" alt="Azure Group Ids" width="1576" height="646" data-path="images/azure-group-ids.png" />
   </Frame>

## Troubleshooting SSO access

When copying the certificate to Minimus, make sure there is no whitespace before or after the certificate. Also, check that the expected prefix and suffix are included.

```text theme={null}
-----BEGIN CERTIFICATE-----

-----END CERTIFICATE-----
```
