> ## 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](../../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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-client-scopes-roles.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=5f008bf137a4573b4134371ae970693c" alt="" width="3452" height="1432" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-client-scope-mappers-create.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=5159fd686f10f877efd836d3bf46d807" alt="" width="3452" height="1420" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-create-protocol-mapper.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=ef15c9f82fd3e8cc954b8d35c12806d2" alt="" width="3452" height="1254" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-anaconda-platform-client.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=b4c24be54d7517e719321343d4aed536" alt="" width="3452" height="1394" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-service-accounts-toggle.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=6f0bc3c7ab9bbfd5c51e179c96c1803b" alt="" width="3452" height="1798" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-service-account-realm-management.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=62f7f260e00da11ed1d52eb4f51f47aa" alt="" width="3452" height="1798" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-service-account-adding-clients-role.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=1c51f065724cd62b77c8586e2ead6396" alt="" width="3460" height="1812" data-path="images/data-science/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/yg2lVfLe5JTI9sv-/images/data-science/keycloak-service-account-effective-roles.png?fit=max&auto=format&n=yg2lVfLe5JTI9sv-&q=85&s=0eb4d40ac2fad31a06b72bc67aaa5025" alt="" width="3452" height="1538" data-path="images/data-science/keycloak-service-account-effective-roles.png" />
   </Frame>

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