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

# Configure Keycloak for Omni

> Steps to integrate Keycloak with Omni using SAML authentication.

1. Log in to Keycloak.
2. Create a realm.

* In the upper left corner of the page, select the dropdown where it says **master**

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-create-realm.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=aa14286a249c3e6d1effea2979280770" alt="" width="1830" height="682" data-path="omni/self-hosted/images/configure-keycloak-for-omni-create-realm.png" />

* Fill in the **realm name** and select **create**

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-omni-create.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=aec5abec0d934334f70d97050dbeaff6" alt="" width="1839" height="680" data-path="omni/self-hosted/images/configure-keycloak-for-omni-omni-create.png" />

3. Select **Realm settings** in the sidebar, and navigate to the **Endpoints > SAML 2.0 Identity Provider Metadata** Link. The link should look a lot similar to this:

   ```bash theme={null}
   https://<keycloak-domain>/realms/<realm>/protocol/saml/descriptor
   ```

   * Copy the link or save its XML data to a file. You will need this for your Omni installation.

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-saml-idp.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=908a4689ae2fa0b6fd716139a9b1d65a" alt="" width="3008" height="1792" data-path="omni/self-hosted/images/configure-keycloak-saml-idp.png" />

4. Create a client

* Select the **Clients** tab on the left

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-create-client.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=51988f0cff261d4385b1dfdb29d7a2c4" alt="" width="1838" height="680" data-path="omni/self-hosted/images/configure-keycloak-for-omni-create-client.png" />

* Fill in the **General Settings** as shown in the example below. **Replace the hostname in the example with your own Omni hostname or IP**.
  * Client type
  * Client ID
  * Name

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-SAML.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=ce2c5d97dbf5f0b9d8c73734bb512916" alt="" width="1830" height="688" data-path="omni/self-hosted/images/configure-keycloak-for-omni-SAML.png" />

* Fill in the **Login settings** as shown in the example below. **Replace the hostname in the example with your own Omni hostname or IP**.
  * Root URL
  * Valid redirect URIs
  * Master SAML Processing URL

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-Root-URL.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=d784a55624d888bebf6f9d897249a31a" alt="" width="1790" height="853" data-path="omni/self-hosted/images/configure-keycloak-for-omni-Root-URL.png" />

* Modify the **Signature and Encryption** settings.
  * Sign documents: **off**
  * Sign assertions: **on**

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-signature-encryption.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=ae6723310cf6bd7a7d1f61357133ce7c" alt="" width="1719" height="856" data-path="omni/self-hosted/images/configure-keycloak-for-omni-signature-encryption.png" />

* Set the **Client signature required** value to **off**.

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-client-signature.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=a11f9ffef127624cb310e20629ca394b" alt="" width="1718" height="721" data-path="omni/self-hosted/images/configure-keycloak-for-omni-client-signature.png" />

* Modify **Client Scopes**

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-client-scopes.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=ca5c2e0ee00b2d0f72757ef4921c6e01" alt="" width="1721" height="600" data-path="omni/self-hosted/images/configure-keycloak-for-omni-client-scopes.png" />

* Select **Add predefined mapper**.

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-predefined-mapper.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=49b812c5ecd66ee991f7489178f4c83d" alt="" width="1723" height="575" data-path="omni/self-hosted/images/configure-keycloak-for-omni-predefined-mapper.png" />

* The following mappers need to be added because Omni will use these attributes for assigning permissions.
  * X500 email
  * X500 givenName
  * X500 surname

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-add-predefined-mappers.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=a9d30ff442d99e014b963ddc7f3f289a" alt="" width="1720" height="732" data-path="omni/self-hosted/images/configure-keycloak-for-omni-add-predefined-mappers.png" />

* Add a new user (optional)
  * If Keycloak is being used as an Identity Provider, users can be created here.

<img src="" alt="./images/configure-keycloak-for-omni-create-new-user.png" alt="" />

* Enter the **user information** and set the **Email verified** to **Yes**

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-create-new-user-form.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=23c692f7a683fd7beb553b08435243f8" alt="" width="1719" height="608" data-path="omni/self-hosted/images/configure-keycloak-for-omni-create-new-user-form.png" />

* Set a password for the user.

<img src="https://mintcdn.com/siderolabs-fe86397c/KrpjsTFv1An3UAI_/omni/self-hosted/images/configure-keycloak-for-omni-no-credentials.png?fit=max&auto=format&n=KrpjsTFv1An3UAI_&q=85&s=9b48ce26cce5899c2c97e08331c3a6af" alt="" width="1719" height="575" data-path="omni/self-hosted/images/configure-keycloak-for-omni-no-credentials.png" />
