# SSO With Keycloak

This guide provides step-by-step instructions on how to configure single sign-on (SSO) with Keycloak. You already use Keycloak to conveniently manage permissions to applications. After SSO configuration is complete, you'll also be able to use Keycloak to manage permissions to your Datasources.

### Steps

{% hint style="info" %}
These instructions vary based on your organization's StrongDM region (not your individual location).
{% endhint %}

{% tabs %}
{% tab title="US" %}

1. In your Keycloak admin console, go to the **Clients** section and click **Create** to add a client.
2. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-b495172b6958acc2416f0777eb5c622e8de378c5%2Fsso-keycloak-step-2.png?alt=media)\
   On the **Add Client** page, enter basic information and then save:
   1. **Client ID:** Enter a name like **StrongDM**.
   2. **Client Protocol:** Select **openid-connect**.
   3. **Root URL:** `https://app.strongdm.com`
3. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-955838357e27245a9e10a4b10e448e324ced737a%2Fsso-keycloak-step-3.png?alt=media)\
   On the **Settings** tab, do the following:
   1. Ensure that **Client Protocol** is **openid-connect**.
   2. Set **Access Type** to **confidential**.
   3. Under **Valid Redirect URIs**, add the following URL: `https://app.strongdm.com/auth/return`
   4. Other fields are optional and can be set as you prefer. When done, click **Save**.
4. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-72331feaad60f5c39d6c15bab2212959a877c094%2Fsso-keycloak-step-4.png?alt=media)\
   On the **Credentials** tab, copy the **Secret** value. You will need this in the next step.
5. Next, enter the account details in the StrongDM Admin UI. Go to **Settings** > **User Management**. In the **Single Sign-on** section, set the following:
   1. **Provider:** Select **Keycloak**.
   2. **Single sign-on URL:** Add your URL (add `/auth/realms/<REALM_NAME>` to your Keycloak base URL).
   3. **Client ID**: Enter your client ID.
   4. **Client Secret**: Paste the secret that you copied previously.
6. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-d73b63a75502fea0beef1f490b556008cb551e95%2Fsso-keycloak-step-5.png?alt=media)\
   Select your desired [general SSO settings](https://docs.strongdm.com/admin/principals/sso) and click **activate**.
7. Verify that all users in StrongDM exist in Keycloak.

{% hint style="info" %}
Want to see StrongDM's capabilities beyond SSO with Keycloak? Learn more about [how it works](https://www.strongdm.com/how-it-works) or [get a demo](https://www.strongdm.com/get-a-demo) to see it in action.
{% endhint %}
{% endtab %}

{% tab title="UK" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

1. In your Keycloak admin console, go to the **Clients** section and click **Create** to add a client.
2. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-b495172b6958acc2416f0777eb5c622e8de378c5%2Fsso-keycloak-step-2.png?alt=media)\
   On the **Add Client** page, enter basic information and then save:
   1. **Client ID:** Enter a name like **StrongDM**.
   2. **Client Protocol:** Select **openid-connect**.
   3. **Root URL:** `https://app.strongdm.com`
3. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-955838357e27245a9e10a4b10e448e324ced737a%2Fsso-keycloak-step-3.png?alt=media)\
   On the **Settings** tab, do the following:
   1. Ensure that **Client Protocol** is **openid-connect**.
   2. Set **Access Type** to **confidential**.
   3. Under **Valid Redirect URIs**, add the following URL: `https://app.uk.strongdm.com/auth/return`
   4. Other fields are optional and can be set as you prefer. When done, click **Save**.
4. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-72331feaad60f5c39d6c15bab2212959a877c094%2Fsso-keycloak-step-4.png?alt=media)\
   On the **Credentials** tab, copy the **Secret** value. You will need this in the next step.
5. Next, enter the account details in the StrongDM Admin UI. Go to **Settings** > **User Management**. In the **Single Sign-on** section, set the following:
   1. **Provider:** Select **Keycloak**.
   2. **Single sign-on URL:** Add your URL (add `/auth/realms/<REALM_NAME>` to your Keycloak base URL).
   3. **Client ID**: Enter your client ID.
   4. **Client Secret**: Paste the secret that you copied previously.
6. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-d73b63a75502fea0beef1f490b556008cb551e95%2Fsso-keycloak-step-5.png?alt=media)\
   Select your desired [general SSO settings](https://docs.strongdm.com/admin/principals/sso) and click **activate**.
7. Verify that all users in StrongDM exist in Keycloak.

{% hint style="info" %}
Want to see StrongDM's capabilities beyond SSO with Keycloak? Learn more about [how it works](https://www.strongdm.com/how-it-works) or [get a demo](https://www.strongdm.com/get-a-demo) to see it in action.
{% endhint %}
{% endtab %}

{% tab title="EU" %}
*Follow instructions in the tab for the region of your organization's StrongDM control plane, not your own location. The default control plane region is US.*

1. In your Keycloak admin console, go to the **Clients** section and click **Create** to add a client.
2. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-b495172b6958acc2416f0777eb5c622e8de378c5%2Fsso-keycloak-step-2.png?alt=media)\
   On the **Add Client** page, enter basic information and then save:
   1. **Client ID:** Enter a name like **StrongDM**.
   2. **Client Protocol:** Select **openid-connect**.
   3. **Root URL:** `https://app.strongdm.com`
3. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-955838357e27245a9e10a4b10e448e324ced737a%2Fsso-keycloak-step-3.png?alt=media)\
   On the **Settings** tab, do the following:
   1. Ensure that **Client Protocol** is **openid-connect**.
   2. Set **Access Type** to **confidential**.
   3. Under **Valid Redirect URIs**, add the following URL: `https://app.eu.strongdm.com/auth/return`
   4. Other fields are optional and can be set as you prefer. When done, click **Save**.
4. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-72331feaad60f5c39d6c15bab2212959a877c094%2Fsso-keycloak-step-4.png?alt=media)\
   On the **Credentials** tab, copy the **Secret** value. You will need this in the next step.
5. Next, enter the account details in the StrongDM Admin UI. Go to **Settings** > **User Management**. In the **Single Sign-on** section, set the following:
   1. **Provider:** Select **Keycloak**.
   2. **Single sign-on URL:** Add your URL (add `/auth/realms/<REALM_NAME>` to your Keycloak base URL).
   3. **Client ID**: Enter your client ID.
   4. **Client Secret**: Paste the secret that you copied previously.
6. ![](https://4180056444-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FF7eka9SH5TT8nJm2ZfWj%2Fuploads%2Fgit-blob-d73b63a75502fea0beef1f490b556008cb551e95%2Fsso-keycloak-step-5.png?alt=media)\
   Select your desired [general SSO settings](https://docs.strongdm.com/admin/principals/sso) and click **activate**.
7. Verify that all users in StrongDM exist in Keycloak.

{% hint style="info" %}
Want to see StrongDM's capabilities beyond SSO with Keycloak? Learn more about [how it works](https://www.strongdm.com/how-it-works) or [get a demo](https://www.strongdm.com/get-a-demo) to see it in action.
{% endhint %}
{% endtab %}
{% endtabs %}


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.strongdm.com/admin/principals/sso/keycloak-oidc.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
