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

# Keycloak SSO

> Configure single-sign-on (SSO) for Minimus via Keycloak

Configure Minimus as a custom SAML app in Keycloak to enable SSO for Minimus. To get started, [deploy the Minimus Keycloak image](https://images.minimus.io/images/keycloak/quick-start).

## 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 Keycloak.
   </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 Keycloak 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 log in with SSO from the Minimus homepage.
   2. **Connect Minimus to your identity provider** - You will fetch these parameters from your Keycloak client and save them to the Minimus form:
      1. Login SSO URL
      2. IdP Entity ID
      3. Certificate
   3. **SAML Attribute Mapping** - You will fetch the Keycloak claim names for the following parameters and save them to the Minimus form:
      | Minimus Parameter | Keycloak 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 client in Keycloak

<Steps>
  <Step title="Create a Minimus client in Keycloak">
    Create the Minimus client in Keycloak and link it to your Minimus Console.

    1. Visit your Keycloak admin center. (URL example [http://address:8080/admin/master/console/](http://address:8080/admin/master/console/)) 
    2. Select **Clients** from the left menu > Select **Create client**.
    3. Fill out the form:
       1. **Client type** - Change the selection to **SAML**.
       2. **Client ID** - Copy & paste the value from **Minimus SP Entity ID** ([link to your Minimus form](https://images.minimus.io/manage/access/users?saml=open)).
       3. Name the client and add a description (optional). 
       4. Select **Next** to proceed.

    <Frame caption="How to create a new SAML client in Keycloak">
      <img src="https://mintcdn.com/gutsy-6162adbc/42A8hM8Xedg1-Z3R/images/keycloak-create-new-client-1.png?fit=max&auto=format&n=42A8hM8Xedg1-Z3R&q=85&s=5740a11527772b0a0977689a12d9f601" alt="Keycloak Create New Client 1" width="1817" height="994" data-path="images/keycloak-create-new-client-1.png" />
    </Frame>
  </Step>

  <Step title="Configure the client">
    Configure the client:

    1. Set the following as `https://images.minimus.io`:
       1. **Root URL**
       2. **Home URL**
       3. **Valid post logout redirect URIs**
    2. **Valid Redirect URI** - Set it to `https://images.minimus.io/*`
    3. **IDP-Initiated SSO URL Name** - Set the name as `minimus`
    4. **IDP Initiated SSO Relay State** - for example:
       ```json theme={null}
       {
         "tenantName": "My-Org"
       }
       ```
    5. **Master SAML Processing URL** - Set it as `https://images.minimus.io/saml/callback`
    6. **Save** your changes.

    <Frame caption="How to configure your new SAML client in Keycloak">
      <img src="https://mintcdn.com/gutsy-6162adbc/42A8hM8Xedg1-Z3R/images/keycloak-configure-client.png?fit=max&auto=format&n=42A8hM8Xedg1-Z3R&q=85&s=3d06debd3836cfcb696302ffa90c240a" alt="Keycloak Configure Client" width="1751" height="986" data-path="images/keycloak-configure-client.png" />
    </Frame>
  </Step>

  <Step title="Configure SAML capabilities">
    Scroll down to the section **SAML capabilities** and set the following:

    * **Name ID format** - Select **email** from the dropdown list
    * **Force name ID format** - ON
    * **Force POST binding** - ON

    Scroll down to the section **Signature and Encryption** and set the following:

    * **Sign documents** - ON
    * **Sign assertions** - ON

    Adjust the rest of the optional settings as relevant and save your changes.

    <Frame caption="How to configure SAML capabilities in Keycloak client">
      <img src="https://mintcdn.com/gutsy-6162adbc/WJkEK4NcjsLVkNdT/images/2026-05-10_18-03_1-1.png?fit=max&auto=format&n=WJkEK4NcjsLVkNdT&q=85&s=427b218294964ad9cf3321f058f2c280" alt="2026 05 10 18 03 1 1" width="1365" height="902" data-path="images/2026-05-10_18-03_1-1.png" />
    </Frame>
  </Step>

  <Step title="Disable client signature requirement">
    1. Navigate to the **Keys** tab
    2. The section is named **Signing keys config**
    3. Disable **Client signature required**. You will be asked to confirm your change
    4. **Save** your changes
  </Step>

  <Step title="Configure an email mapper">
    1. Navigate to the **Client scopes** tab in the top bar.
    2. Select your Client ID in the table
       1. Select **Configure a new mapper**
       2. Select **User Property**
    3. Fill in the mapper attributes:
       * **Name** - `email`
       * **Property** - Select `email` from the dropdown list
       * **Friendly Name** - Optional field
       * **SAML Attribute Name** - Paste in `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`
       * **SAML Attribute NameFormat** - Basic
    4. Save your changes

    <Frame caption="How to configure the email user property in a new Keycloak client">
      <img src="https://mintcdn.com/gutsy-6162adbc/WJkEK4NcjsLVkNdT/images/keycloak-user-property.png?fit=max&auto=format&n=WJkEK4NcjsLVkNdT&q=85&s=6ad737dd20779ca3d31449255bd5971c" alt="Keycloak User Property" width="967" height="620" data-path="images/keycloak-user-property.png" />
    </Frame>
  </Step>

  <Step title="Configure a second mapper">
    1. In the mappers table, select **Add mapper > By configuration**
    2. Select **User Property**
    3. Fill in the mapper attributes:
       * **Name** - Type in `fullName`
       * **Property** - Select `firstName` from the dropdown list
       * **SAML Attribute Name** - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`
       * **SAML Attribute NameFormat** - Basic
    4. **Save** your changes

    <Frame caption="How to configure the fullName user property in a new Keycloak client">
      <img src="https://mintcdn.com/gutsy-6162adbc/WJkEK4NcjsLVkNdT/images/user-property-keycloak-attributes.png?fit=max&auto=format&n=WJkEK4NcjsLVkNdT&q=85&s=a2deb68265586b23f11360e227310470" alt="User Property Keycloak Attributes" width="994" height="630" data-path="images/user-property-keycloak-attributes.png" />
    </Frame>
  </Step>

  <Step title="Copy the certificate">
    1. In the left menu, select **Realm settings**.
    2. In the **General** tab, select **SAML 2.0 Identity Provider Metadata**.
    3. Copy the certificate between `<ds:X509Certificate>` and `</ds:X509Certificate>`.

    <Frame caption="How to locate the Keycloak certificate in Keycloak Realm settings">
      <img src="https://mintcdn.com/gutsy-6162adbc/42A8hM8Xedg1-Z3R/images/keycloak-saml-certificate.png?fit=max&auto=format&n=42A8hM8Xedg1-Z3R&q=85&s=66a563a77d07fbf6759dfd58a0dc8758" alt="Keycloak Saml Certificate" width="1440" height="746" data-path="images/keycloak-saml-certificate.png" />
    </Frame>
  </Step>

  <Step title="Configure SAML in Minimus">
    1. In your Minimus console, go to **Manage** > **Users & Groups** > **Configure SSO**.
    2. Fill the following fields:
       * **IdP Entity ID** - `https://YOUR_KEYCLOAK_EXTERNAL_IP_OR_URL/realms/master`
       * **Login URL** - `https://YOUR_KEYCLOAK_EXTERNAL_IP_OR_URL/realms/master/protocol/saml`
       * **Certificate** - Paste the certificate you copied in the previous step.
    3. Fill in the SAML Attribute Mapping fields:
       * **Email** - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress`
       * **Full Name** - `http://schemas.xmlsoap.org/ws/2005/05/identity/claims/name`
       * **Group Mapping** - `groups`
    4. **Save** your changes. 
  </Step>
</Steps>

That's it! You should now be able to manage access to Minimus with Keycloak SSO.

## 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-----
```
