Creating a Realm Admin User in Keycloak
This guide describes how to create a dedicated administrative user that can manage clients and create service accounts within the Dare-Control realm.
Prerequisites
- Access to the Keycloak Admin Console.
- A user with Realm Administrator privileges.
Log in to the Admin Console
- Open the Keycloak Admin Console.
- Sign in using an administrator account.
- Select the Dare-Control realm.
⚠️
Create the user in the Dare-Control realm, not the master realm.
Create the User
- Navigate to Users.
- Select Add user.
- Enter the following details:
| Field | Value |
|---|---|
| Username | dare-control-realm-admin |
| Enabled | ✅ Enabled |
| Email verified | Optional |
- Select Create.
Set a Password
- Open the Credentials tab.
- Select Set password.
- Enter the desired password.
- Disable Temporary.
- Save the password.
Assign Realm Management Roles
- Open the Role mapping tab.
- Select Assign role.
- Change Filter by clients to realm-management.
- Assign the following client roles:
| Role | Purpose |
|---|---|
create-client | Allows the creation of new clients within the realm. |
manage-clients | Create and manage clients. |
manage-users | Modify user role mappings when assigning roles to service accounts. |
view-clients | View client configuration. |
query-clients | Query clients through the Admin API. |
map-roles | Assign roles to service accounts. |
view-users | View service account users. |
query-users | Query service account users. |
After creating the user and setting the password, configure the same credentials in the Submission Layer using the following environment variables:
KeycloakAdmin__UsernameKeycloakAdmin__Password
These values must match the username and password configured for this user.
Verify the Configuration
The user should now be able to:
- Create confidential clients.
- Enable Service Accounts.
- Retrieve the generated service account user.
- Assign realm roles to the service account.
- Update the service account’s role mappings.
- Create this user in the Dare-Control realm.
- This user does not need full Realm Administrator privileges.
- The roles above provide the minimum permissions required by the Submission API to create clients, enable service accounts, and assign roles to those service accounts.