Configuring Keycloak
There are multiple methods of deploying Keycloak. Documentation on Keycloak deployment can be found on the Official Keycloak website.
With Docker installed and running on your system you can quickly spin up Keycloak by running:
docker run --name keycloak -d \
-p 8080:8080 \
-e KEYCLOAK_ADMIN=admin \
-e KEYCLOAK_ADMIN_PASSWORD=admin \
quay.io/keycloak/keycloak:22.0 start-dev
If you need to install Docker, visit the official Docker installation guide.
This command starts Keycloak on local port 8080 and creates an initial admin user with the username admin and password admin.
This setup is designated for development and testing purposes and should not be used in production settings. For production deployments, please refer to Configuring Keycloak for Production.
Overture API Key Provider
The Overture API Key provider extends Keycloak's functionality by adding custom logic that allows Keycloak to interact with Song. The following steps outline how to download and install the Overture API Key provider:
-
Download the Overture API Key Provider.
-
Move the
keycloak-apikeys.jarfile to the provider's folder within Keycloak (opt/keycloak/providers/). -
Restart the Keycloak server for the updated provider to take effect.
Previously Set Up Keycloak?If you have previously set up Score with Keycloak, you can skip ahead to the application setup section on this page.
Realm Configuration
Login to the admin console

To access the admin console, navigate to <url>/admin (e.g., localhost:8080/admin) and log in with the credentials made during your Keycloak deployment.
Create a realm
Keycloak supports the creation of realms for managing isolated groups of applications and users. The default realm is named "master," and is intended solely for Keycloak management.

- Open the Keycloak Admin Console.
- In the top-left corner, select "master", then choose "Create Realm".
- Type
myrealmin the Realm Name field and select "Create".
Creating a group
As an example, we will create a data submitters group. After, we will configure and apply the appropriate permissions for this group.

-
From the left-hand panel, select "Groups" and click "Create group".
-
Name the group
data submittersand select "create".
Creating a User
To populate the realm with its first user:

-
From the Keycloak Admin Console, under your newly created realm from the left-hand menu select "Users" and click "Add User".
-
Input your details, and then click "Create".
Keycloak User AdministrationVarious configurations can be applied to new users, detailed information can be found within Keycloaks official Server Administration documentation
Next, a password must be established:
-
At the top of the User details page, select the "Credentials tab"
-
Input your Password. To avoid mandatory password updates upon first login set "Temporary" to "Off"
-
Using the newly created username and password login to the Keycloak Account Console accessed from
http://localhost:8080/realms/myrealm/account/.
From the Account Console, users can manage their accounts, modify profiles, activate two-factor authentication, and link identity provider accounts.
Application Setup
Before we set up and apply permissions we must create a "client" for the Song API.
-
Re-open your Keycloak admin console located at
<url>/adminand confirm you are within your recently created realm. -
Select "Clients" and then "Create client" and input the following:
Field Value Client Type OpenID Connect Client ID song-api -
Select "Next" and turn on Client Authentication, confirm Standard flow is enabled, turn authorization on and then click "next" and then "Save" (Nothing needs to be inputted for login settings).
ImportantMake sure you have toggled on both "Client Authentication" and "Authorization"