Git Product home page Git Product logo

keycloak-event-listener-redis's Introduction

keycloak-event-listener-redis

A Keycloak SPI that publishes events via Redis PubSub. Inspired by keycloak-event-listener-mqtt.

Build

mvn clean install

Deploy

  • Copy target/event-listener-redis-10.0.0-jar-with-dependencies.jar to {KEYCLOAK_HOME}/standalone/deployments

  • Edit standalone.xml to configure the Redis service settings. Find the following section in the configuration:

    <subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">
        <web-context>auth</web-context>
    

    And add below a record for redis:

    <spi name="eventsListener">
        <provider name="redis" enabled="true">
            <properties>
                <property name="host" value="[REDIS HOST]"/>
                <property name="port" value="[REDIS PORT]"/>
                <property name="db" value="[REDIS DB ID]"/>
                <property name="channel" value="[PUBSUB CHANNEL NAME]"/>
            </properties>
        </provider>
    </spi>
    

    Note that you can have multiple eventsListener providers. If you have some already, just append the redis block.

    Individual values have some defaults:

    • host defaults to localhost
    • port defaults to 6379
    • db defaults to 1
    • channel defaults to keycloak/events.
  • Restart your Keycloak server.

Docker

This plays well with Docker deployments, too. Just spawn your custom Docker file and add something like this:

FROM quay.io/keycloak/keycloak:10.0.2

COPY ./extensions/event-listener-redis-10.0.0-jar-with-dependencies.jar /opt/jboss/keycloak/standalone/deployments/
COPY ./standalone-ha.xml /opt/jboss/keycloak/standalone/configuration/standalone-ha.xml

CMD ["-b", "0.0.0.0"]

This assumes you have extensions/event-listener-redis-10.0.0-jar-with-dependencies.jar and standalone-ha.xml available next to your Dockerfile. Please note that Docker deployments use standalone-ha.xml by default at the time of this writing.

keycloak-event-listener-redis's People

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.