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

# Keycloak Upgrade

With the release of Anaconda Enterprise 5.6, significant improvements have been made to our Keycloak implementation. For details, please see the [release notes](/docs/data-science/5.6.1/reference/release-notes).

Upgrading to Anaconda Enterprise 5.6 requires Keycloak configuration changes to access your instance. You’ll need to add a protocol mapper to the `roles` client scope, then add a service account with permissions to the `anaconda-platform` client.

* [Adding the protocol mapper](#adding-the-protocol-mapper)
* [Adding the service account](#adding-the-service-account)

## Adding the protocol mapper

After your upgrade to Anaconda Enterprise 5.6 completes:

1. Open a browser and log in to your Keycloak admin panel using your existing Keycloak credentials. Your Keycloak admin panel can be found at `www.YOUR\_DOMAIN/auth/admin`.

2. Navigate to the **Client Scopes** page from the left-hand navigation menu, then select **roles** from the list.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-client-scopes-roles.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=3b66785e355bf9cfe6eb205abf089032" alt="" width="3452" height="1432" data-path="images/keycloak-client-scopes-roles.png" />
   </Frame>

3. Select the **Mappers** tab at the top of the page, then click **Create** to begin creating a new protocol mapper for this client scope.

<Frame>
  <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-client-scope-mappers-create.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=489b957f1bf1f3d3e3ecc2673e6ae649" alt="" width="3452" height="1420" data-path="images/keycloak-client-scope-mappers-create.png" />
</Frame>

4. Fill in the fields and set the toggle switches as indicated:

   * **Name**: my-app-audience
   * **Mapper Type**: Audience
   * **Included Client Audience**: anaconda-platform
   * **Add to ID token**: `ON`
   * **Add to access token**: `ON`

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-create-protocol-mapper.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=b30f2930a3331d0a5c868625eda50874" alt="" width="3452" height="1254" data-path="images/keycloak-create-protocol-mapper.png" />
   </Frame>

5. Click **Save**.

## Adding the service account

1. Navigate to the **Clients** page from the left-hand navigation menu, then select *anaconda-platform* from the list.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/_0MqQ39OoYOKQTk5/images/keycloak-anaconda-platform-client.png?fit=max&auto=format&n=_0MqQ39OoYOKQTk5&q=85&s=92c008f0f918284e80688f3e5b328538" alt="" width="3452" height="1394" data-path="images/keycloak-anaconda-platform-client.png" />
   </Frame>

2. Set the **Service Accounts Enabled** toggle to ON, then click **Save** at the bottom of the page.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-service-accounts-toggle.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=d240e7c883eafd1e1ca869a73207de61" alt="" width="3452" height="1798" data-path="images/keycloak-service-accounts-toggle.png" />
   </Frame>

3. Select the new **Service Account Roles** tab at the top of the page, then open the **Client Roles** dropdown menu and select *realm-management*.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-service-account-realm-management.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=b30d9b2e4cc2a8641cc4581a71b6df54" alt="" width="3452" height="1798" data-path="images/keycloak-service-account-realm-management.png" />
   </Frame>

4. Select *view-users* from the **Available Roles** list and then click **Add Selected >>**.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-service-account-adding-clients-role.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=7ba3698e7b22863877bd2a802ad2678a" alt="" width="3460" height="1812" data-path="images/keycloak-service-account-adding-clients-role.png" />
   </Frame>

5. Verify that the *view-users*, *query-users*, and *query-groups* roles appear in the **Effective Roles** list.

   <Frame>
     <img src="https://mintcdn.com/anaconda-29683c67/FWjHZXWDjYmx0_bG/images/keycloak-service-account-effective-roles.png?fit=max&auto=format&n=FWjHZXWDjYmx0_bG&q=85&s=392de6de05cae15053e2374c5156db2f" alt="" width="3452" height="1538" data-path="images/keycloak-service-account-effective-roles.png" />
   </Frame>

Success! You can now log in to your instance from an existing account and use AE5 normally.
