{"id":19133450,"url":"https://github.com/pedro-hos/keycloak-dashbuilder","last_synced_at":"2025-07-19T02:32:48.803Z","repository":{"id":83501267,"uuid":"603876583","full_name":"pedro-hos/keycloak-dashbuilder","owner":"pedro-hos","description":"Keycloak Dashbuilder Integration","archived":false,"fork":false,"pushed_at":"2023-03-01T17:22:15.000Z","size":926,"stargazers_count":7,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-02-22T17:46:38.558Z","etag":null,"topics":["dashboard","dashbuilder","keycloak"],"latest_commit_sha":null,"homepage":"","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pedro-hos.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-02-19T20:23:56.000Z","updated_at":"2024-07-07T21:02:56.000Z","dependencies_parsed_at":null,"dependency_job_id":"77b3c11a-8952-4450-bc38-6dd83fe0f5eb","html_url":"https://github.com/pedro-hos/keycloak-dashbuilder","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pedro-hos/keycloak-dashbuilder","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-hos%2Fkeycloak-dashbuilder","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-hos%2Fkeycloak-dashbuilder/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-hos%2Fkeycloak-dashbuilder/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-hos%2Fkeycloak-dashbuilder/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pedro-hos","download_url":"https://codeload.github.com/pedro-hos/keycloak-dashbuilder/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pedro-hos%2Fkeycloak-dashbuilder/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265876919,"owners_count":23842956,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dashboard","dashbuilder","keycloak"],"created_at":"2024-11-09T06:22:31.507Z","updated_at":"2025-07-19T02:32:48.778Z","avatar_url":"https://github.com/pedro-hos.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# keycloak-dashbuilder\n[![License](https://img.shields.io/github/license/kiegroup/kie-tools.svg)](https://github.com/pedro-hos/keycloak-dashbuilder/blob/main/LICENSE)\n\nThis is a Quarkus project that connects to Keycloak REST API as a proxy and build Dashboards using the [Dashbuilder](https://www.dashbuilder.org/) project.\n\nSo, you can now build your own dashboard using Dashbuilder YAML and analyze your data properly.\n\n# Table of Contents\n\n1. [Requirements](#requirements)\n2. [Tested Versions](#tested-versions)\n3. [Install and Setup Keycloak](#install-and-setup-keycloak)\n    * [By importing REALM File](#by-importing-realm-file)\n    * [Using kcadm](#using-kcadm)\n4. [Configuring Keycloak-dashbuilder project](#configuring-keycloak-dashbuilder-project)\n5. [Other Integrations](#other-integrations)\n6. [How to create other Dashboards?](#how-to-create-other-dashboards)\n7. [Screens](#screens)\n\n## Requirements\n- Java JDK 17\n- Maven 3.8.5 or above\n\n## Tested Versions\n\n| Keycloak Version \t| RH-SSO Version \t| Quarkus Dashbuilder Version \t|\n|------------------\t|----------------\t|-----------------------------\t|\n| 21.0.0           \t| -              \t| 0.26.1                      \t|\n| 20.0.5           \t| -              \t| 0.26.1                      \t|\n| 20.0.5           \t| -              \t| 0.26.1                      \t|\n| -                \t| 7.6.1          \t| 0.26.1                      \t|\n\n_Note: You need to use [kcadm.sh](#using-kcadm) instead import the Realm File in case of running RH-SSO 7.6._\n\n## Install and Setup Keycloak\n\n### By importing REALM File\n\n1. First you need to [download](https://www.keycloak.org/downloads) and run Keycloak 20.x as following:\n\n```\nsh bin/kc.sh start-dev --metrics-enabled=true\n```\n\n2. Import the [config/realm-export.json](https://raw.githubusercontent.com/pedro-hos/keycloak-dashbuilder/main/config/realm-export.json) on your running Keycloak environment\n\n![Keycloak Create Realm](/img/create_realm.png \"Keycloak Create Realm\")\n\n3. Create a new User at Keycloak Dashbuilder Realm. On this new user go to **Role Mapping** tab and find by `realm-admin` role and assing it to the new user created. This new user should use this role in order to have admin permissions.\n\n![Keycloak User Config](/img/user_config.png \"Keycloak User Config\")\n\n- When you click in Assign Role, it is possible that `realm-admin` role will not be shown by default, so you have to select **Filter by clients** and then use the search box:\n\n![Keycloak User Config](/img/assign_role.png \"Assign realm-admin role Keycloak User Config\")\n\n\n4. Go to **Clients** and click on **dashboard** client, then go to **Credentials** and copy the **Secret** value and save.\n\n![Keycloak Secret Config](/img/secret_config.png \"Keycloak Secret Config\")\n\n### Using kcadm\n\n1. First you need to [download](https://www.keycloak.org/downloads) and run Keycloak 20.x as following:\n\n```\nsh bin/kc.sh start-dev --metrics-enabled=true\n```\n\n2. Login at your realm using `kcadm.sh`. So, go to `bin/` folder and run the following commands:\n\n~~~\n./kcadm.sh config credentials --server http://localhost:8080/ --realm master --user {MASTER_USER} --password {MASTER_PASS}\n~~~\n\n3. Create new Dashbuilder Realm\n\n```\n./kcadm.sh create realms -s realm=dashbuilder -s enabled=true\n```\n\n4. Enable events on **Events**, **Config** tab and enable **Save Events** for **Login Events Settings** and **Admin Events Settings**\n\n```\n./kcadm.sh update events/config -r dashbuilder -s \"eventsEnabled=true\" -s \"adminEventsEnabled=true\"\n```\n_Note: If you are using [Keycloak Metrics SPI](https://github.com/aerogear/keycloak-metrics-spi), you'd to add the metrics-listener on Events Listeners. If you're using [Keycloak Native Metrics](https://www.keycloak.org/server/all-config?q=metric) you don't_\n\n```\n./kcadm.sh update events/config -r dashbuilder -s \"eventsEnabled=true\" -s \"adminEventsEnabled=true\" -s \"eventsListeners+=metrics-listener\"\n```\n\n5. Create new client on dashbuilder realm:\n\n```\n./kcadm.sh create clients -r dashbuilder -s clientId=dashboards -s enabled=true -s clientAuthenticatorType=client-secret -s baseUrl=http://localhost:8081/dashboards -s redirectUris='[\"http://localhost:8081/dashboards/*\"]'\nCreated new client with id '6c922c7c-6b2d-44ff-909f-33279b5ff257'\n```\n\n_Note: Copy the client id to use on the next steps_\n\n6. Creating the client secret with the `client id` created on step 5.\n\n```\n./kcadm.sh create -r dashbuilder clients/$CID/client-secret\n```\n\n7. Retrieve the client secret with the `client id` created on step 5.\n\n```\n./kcadm.sh get -r dashbuilder clients/$CID --fields 'secret'\n{\n  \"secret\" : \"FafS0NayqjSbCDjOTmYvqgK0NUeaoUML\"\n}\n```\n\n_Copy that value and sabe, we'll use it before_\n\n8. Now, we need to create a new user and set the password.\n\n```\n./kcadm.sh create users -r dashbuilder -s username=testuser -s enabled=true\n./kcadm.sh set-password -r dashbuilder --username testuser --new-password secret\n```\n_You can change the new user, and password as needed_\n\n9. Finally, we need to grant the `realm-admin` role to the new user to be able to use the REST API\n\n```\n./kcadm.sh add-roles -r dashbuilder --uusername testuser --cclientid realm-management --rolename realm-admin\n```\n\n## Configuring Keycloak-dashbuilder project\n\n1. on `src/resources/application.properties` edit the following paramenters:\n\n```\nquarkus.http.port=8081\nquarkus.http.cors=true\n\napi.keycloak.admin-url=[A]\napi.keycloak.metrics-url=[B]\napi.keycloak.health-url=[C]\n\nquarkus.oidc.auth-server-url=[D]\nquarkus.oidc.client-id=dashboards\nquarkus.oidc.application-type=web-app\nquarkus.http.auth.permission.authenticated.paths=/*\nquarkus.http.auth.permission.authenticated.policy=authenticated\n\nquarkus.http.auth.permission.public.paths=/q/dev\nquarkus.http.auth.permission.public.policy=permit\n\nquarkus.oidc.credentials.secret=[E]\n```\n- [A] Your REST API base URL. For example: `http://localhost:8080/admin/realms/dashbuilder/`\n- [B] Keycloak metrics URL, using `--metrics-enabled=true`should be present at `/metrics`. For example: `http://localhost:8080/metrics`\n- [C] Keycloak health URL, using [keycloak-health-checks](https://github.com/thomasdarimont/keycloak-health-checks) as your SPI should be present at `/health/check`. For example: `http://localhost:8080/realms/dashbuilder/health/check`\n- [D] Your Keycloak REALM URL. For exaple `http://localhost:8080/realms/dashbuilder`\n- [E] Secrect that you have copied before. For example `oAQad2nZJRZNDHxC1j59LGpQrlYRBodn`\n\nYou can retrieve the secret by `kcadm.sh` as following, where `$CID` is the created client id:\n\n```\n./kcadm.sh get -r dashbuilder clients/$CID --fields 'secret'\n{\n  \"secret\" : \"FafS0NayqjSbCDjOTmYvqgK0NUeaoUML\"\n}\n```\n\nor going to **Clients** -\u003e **dashboards** -\u003e **Credentials** tab\n\n![Keycloak Secret Config](/img/secret_config.png \"Keycloak Secret Config\")\n\n2. You can now compile and run the project\n\n```\n./mvnw quarkus:dev\n```\n\n3. Finally you can access the **Dashboards**, `http://localhost:8081/dashboards/`. You should be redirected to the Keycloak Login Page, so, login with the created user.\n\n## Other Integrations\n\nYou can also, compile and install [keycloak-health-checks](https://github.com/thomasdarimont/keycloak-health-checks) as your SPI and use it on  Dashbuilders\n\n## How to create other Dashboards?\n\nYou need to edit the `src/main/resources/dashboards/monitor.dash.yaml` in order to add more dashboards. Learn how to create dashboards by following [Dashbuilder YAML guide](https://www.dashbuilder.org/docs/#chap-dashbuilder-yaml-guides).\n\n## Screens\n\n### Metrics\n\n![Metrics](/img/metrics.png \"Metrics\")\n\n### Health\n\n![Health](/img/health.png \"Health\")\n\n### Admin Events\n\n![Admin Events](/img/admin_events.png \"Admin Events\")\n\n### Login Events\n\n![Events](/img/login_events.png \"Events\")\n\n### Sessions\n\n![Sessions](/img/sessions.png \"Sessions\")\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedro-hos%2Fkeycloak-dashbuilder","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpedro-hos%2Fkeycloak-dashbuilder","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpedro-hos%2Fkeycloak-dashbuilder/lists"}