{"id":14384280,"url":"https://github.com/softwarefactory-project/keycloak-event-listener-mqtt","last_synced_at":"2026-06-01T12:31:33.985Z","repository":{"id":44401690,"uuid":"182049963","full_name":"softwarefactory-project/keycloak-event-listener-mqtt","owner":"softwarefactory-project","description":"A Keycloak SPI that publishes events to a MQTT broker.","archived":false,"fork":false,"pushed_at":"2024-05-22T13:33:20.000Z","size":62,"stargazers_count":41,"open_issues_count":2,"forks_count":11,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-08-23T19:45:48.392Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Java","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/softwarefactory-project.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":"2019-04-18T08:39:43.000Z","updated_at":"2025-04-24T11:00:46.000Z","dependencies_parsed_at":"2024-06-12T14:12:00.189Z","dependency_job_id":null,"html_url":"https://github.com/softwarefactory-project/keycloak-event-listener-mqtt","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/softwarefactory-project/keycloak-event-listener-mqtt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fkeycloak-event-listener-mqtt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fkeycloak-event-listener-mqtt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fkeycloak-event-listener-mqtt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fkeycloak-event-listener-mqtt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/softwarefactory-project","download_url":"https://codeload.github.com/softwarefactory-project/keycloak-event-listener-mqtt/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/softwarefactory-project%2Fkeycloak-event-listener-mqtt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33775857,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-01T02:00:06.963Z","response_time":115,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-08-28T18:01:16.662Z","updated_at":"2026-06-01T12:31:33.967Z","avatar_url":"https://github.com/softwarefactory-project.png","language":"Java","funding_links":[],"categories":["Java"],"sub_categories":[],"readme":"# keycloak-event-listener-mqtt\n\nA Keycloak SPI that publishes events to a MQTT broker.\n\nThis SPI has been deployed successfully on a containerized Keycloak 22.0.\nIt should therefore work properly on any version of Keycloak above 22.0.\n\n# Build\n\n```\nmvn clean install\n```\n\nTo build the SPI for use with a version of Keycloak prior to 22.X, you need to use openjdk 11 and patch pom.xml to target java 11:\n\n```\n\u003csource\u003e11\u003c/source\u003e\n\u003ctarget\u003e11\u003c/target\u003e\n```\n\n# Deploy\n\n## Keycloak on Wildfly\n\n* Copy target/event-listener-mqtt-jar-with-dependencies.jar to {KEYCLOAK_HOME}/standalone/deployments\n* Edit standalone.xml to configure the MQTT service settings. Find the following\n  section in the configuration:\n\n```\n\u003csubsystem xmlns=\"urn:jboss:domain:keycloak-server:1.1\"\u003e\n    \u003cweb-context\u003eauth\u003c/web-context\u003e\n```\n\nAnd add below:\n\n```\n\u003cspi name=\"eventsListener\"\u003e\n    \u003cprovider name=\"mqtt\" enabled=\"true\"\u003e\n        \u003cproperties\u003e\n            \u003cproperty name=\"serverUri\" value=\"tcp://127.0.0.1:1883\"/\u003e\n            \u003cproperty name=\"username\" value=\"mqtt_user\"/\u003e\n            \u003cproperty name=\"password\" value=\"mqtt_password\"/\u003e\n            \u003cproperty name=\"topic\" value=\"my_topic\"/\u003e\n            \u003cproperty name=\"usePersistence\" value=\"true\"\u003e\n            \u003cproperty name=\"retained\" value=\"true\"\u003e\n            \u003cproperty name=\"cleanSession\" value=\"true\"\u003e\n            \u003cproperty name=\"qos\" value=\"0\"\u003e\n        \u003c/properties\u003e\n    \u003c/provider\u003e\n\u003c/spi\u003e\n```\nLeave username and password out if the service allows anonymous write access.\nIf unset, the default message topic is \"keycloak/events\".\nBy default, the SPI won't use persistence. If set to true, messages will be persisted in memory.\n\n* Restart the keycloak server.\n\n## Keycloak on Quarkus\n\n* Copy the jar archive to /opt/keycloak/providers/ in the keycloak container.\n* run keycloak with the following options:\n\n```\nkc.sh start\n  --spi-events-listener-mqtt-server-uri tcp://your.mqtt.server:port \\\n  --spi-events-listener-mqtt-publisher-id kc-mqtt \\\n  --spi-events-listener-mqtt-username mqtt_user \\\n  --spi-events-listener-mqtt-password mqtt_password \\\n  --spi-events-listener-mqtt-topic my_topic \\\n  --spi-events-listener-mqtt-use-persistence true \\\n  --spi-events-listener-mqtt-retained true \\\n  --spi-events-listener-mqtt-clean-session true \\\n  --spi-events-listener-mqtt-qos 0\n```\n\n# Trying it out\n\nThe Dockerfile in the `testing` directory can be used to build a keycloak container image\nwith the listener pre-installed. It assumes the compiled jar has been generated.\n\nThe compose in the same directory will launch keycloak and a MQTT server; keycloak is configured\nto publish to this server - however the listener must be enabled on any realm.\n\nThe `demo.sh` script at the root of the repository automates all the steps above up to and\nincluding configuring the master realm to publish events to the MQTT server, and can be used\nto test the event listener out.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarefactory-project%2Fkeycloak-event-listener-mqtt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsoftwarefactory-project%2Fkeycloak-event-listener-mqtt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsoftwarefactory-project%2Fkeycloak-event-listener-mqtt/lists"}