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

# Channel service accounts

<Note>
  Channel service accounts are only available in Package Security Manager (On-prem) version 6.6.5.
</Note>

Channel service accounts are non-human user identities used by Package Security Manager to access and interact with channels programmatically. Once enabled, a service account named `service-account-channel-<CHANNEL_NAME>` is automatically created whenever a new channel is established.

Because this feature is not enabled by default, you must configure your system to allow the creation of these accounts and provide them with the permissions they need to take actions on channels on your behalf.

## Enabling channel service accounts

1. Open <Tooltip tip="A command-line application included with Windows installations of Anaconda Distribution and Miniconda. Find it by searching 'Anaconda Prompt' in the Windows Start menu.">Anaconda Prompt</Tooltip> (Terminal on macOS/Linux) and connect to your instance of Package Security Manager.

2. Navigate to the `ate-installer-*/keycloak` directory.

3. Using your preferred editor, open the `kc.yaml` file for editing. You might need to use the `sudo` directive to get permissions to edit the file. For example:

   ```sh theme={null}
   # Replace <INSTALLER_DIRECTORY> with your installer directory
   cd ~/<INSTALLER_DIRECTORY>/keycloak/
   sudo vi kc.yaml
   ```

4. Add the `manage-clients` role to the `clients: - client_roles: realm-management:` section of the `repo-account-sync` client as shown below:

   ```yaml theme={null}
   clients:
     - clientId: repo-account-sync
       description: KC internal management client
       redirectUris:
         - /api/auth/callback/kc
       serviceAccountsEnabled: true
       protocolMappers:
         - name: username
           protocol: openid-connect
           protocolMapper: oidc-usermodel-attribute-mapper
           config:
             "user.attribute": username
             "claim.name": user_name
             "id.token.claim": true
             "access.token.claim": true
             "userinfo.token.claim": true
       client_roles:
         realm-management:
           - manage-users
           - manage-realm
           - manage-clients
   ```

5. Save the changes and close the file.

6. Navigate back to the `ate-installer-*` directory.

7. Using your preferred editor, open the `docker-compose.yml` file for editing.

8. Add the following environment variable to the `repo_api: environment:` section:

   ```sh theme={null}
   REPO_CHANNEL_SERVICE_ACCOUNT=True
   ```

9. Save your changes and close the file.

10. Apply your environmental changes by running the following commands:

    ```sh theme={null}
    docker compose up -d
    ```

## Managing channel service accounts

Channel service accounts can be managed using the [Command Line Interface (CLI)](../user/cli#channel-service-accounts) or the [Application Programming Interface (API)](../user/channel#managing-channels-with-the-api).
