GithubHelp home page GithubHelp logo

cevheri / keycloak-custom-event-listener Goto Github PK

View Code? Open in Web Editor NEW
21.0 3.0 5.0 187 KB

Keycloak Extension - Custom Event Listener. User create and register events, listen and Call Rest API with Java

Java 100.00%
java keycloak keycloak-spi keycloak-extension docker docker-compose mockapi

keycloak-custom-event-listener's Introduction

Keycloak Extension

Custom Event Listener and API publisher

"User create" and "register" events, listen and Call Rest API with Java


Clone :

git clone https://github.com/cevheri/keycloak-custom-event-listener

cd keycloak-custom-event-listener

Generate JAR:

mvn clean package

Attach keycloak dockerVolume (already in docker-compose file)

    volumes:
      - ../../../target/custom-event-listener.jar://opt/jboss/keycloak/standalone/deployments/custom-event-listener.jar

Run on Docker:

docker-compose -f src/main/docker/docker-compose.yml up -d

Keycloak Admin Console Configuration :

  • Open Keycloak Admin Console
  • Login with admin user
  • Go to "Events" -> "Config" -> "Config" -> "Event Listeners"
  • Add "custom-event-listener" to "Event Listeners"
  • Save


Create New User:

  • Go to "Users" -> "Add User"
  • Fill the form and click "Save"
  • Check the API result on MockAPI


API Design

Hi-Level API Design

  • Our motivation is to call an API when a user is created or registered.
  • We will use a mock API for this example.

keycloak-event-listener-call-api.png


Test Result on MockAPI:

Setup Mock API


View api result


Stop Docker:

docker-compose -f src/main/docker/docker-compose.yml down

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.