Changing the dataset provider

This guide describes how to create local modifications to the dataset provider by a developer.

Overview

This guide targets Java developers.

To be able to test changes made to the provider, the provider needs to be deployed in a running instance of Keycloak. After each change to the provider’s JAR file, it needs to be re-deployed to Keycloak.

Prerequisites

Knowledge of Java and of Keycloak’s Java APIs necessary or needs to be learned during development.

The recommended setup is to first complete the guide Installing the dataset provider in Keycloak on minikube as it is fully scripted and prepared for remote debugging.

Developing the provider against Keycloak Wildfly, or with a locally running instance of Keycloak Quarkus is possible as well, still it is not part of this guide today.

Preparing changes using the local setup

After opening the Keycloak Benchmark project in an IDE, proceed as follows to implement new or changed requirements:

  1. Change the source code in /dataset/src as needed.

  2. Start the test class DeploymentIT from the IDE from the module’s file path. It will package the provider and install into a Quarkus instance of Keycloak.

  3. Open http://localhost:8080 to interact with Quarkus, and use remote-debugging.

  4. Remote debugging is available on port 8787, and test the provider’s REST APIs.

  5. Repeat from step 1 until the requirements are satisfied.

Preparing changes using the Minikube setup

After opening the Keycloak Benchmark project in an IDE, proceed as follows to implement new or changed requirements:

  1. Change the source code in /dataset/src as needed.

  2. Run the task as described in Installing on Minikube to update the installation. This builds a new version of the dataset provider’s JAR file, deploys it to minikube and restarts Keycloak.

  3. Follow the instructions in Debugging Keycloak to connect to the running Keycloak instance and debug the provider, and test the provider’s API as outlined in Generating datasets.

  4. Repeat from step 1 until the requirements are satisfied.