GithubHelp home page GithubHelp logo

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

View Code? Open in Web Editor NEW
21.0 2.0 4.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

keycloak-custom-event-listener's People

Contributors

cevheri avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

keycloak-custom-event-listener's Issues

Could not resolve dependencies for project com.cevher.keycloak:custom-event-listener:jar:0.0.1

Hi guys, I have cloned the repository and run 'mvn clean package' then I have a issue like below

Failed to execute goal on project custom-event-listener: Could not resolve dependencies for project com.cevher.keycloak:custom-event-listener:jar:0.0.1: The following artifacts could not be resolved: org.keycloak:keycloak-core:jar:0.0.1 (absent), org.keycloak:keycloak-server-spi:jar:0.0.1 (absent), org.keycloak:keycloak-server-spi-private:jar:0.0.1 (absent), org.keycloak:keycloak-services:jar:0.0.1 (absent), org.keycloak:keycloak-saml-core-public:jar:0.0.1 (absent): org.keycloak:keycloak-core:jar:0.0.1 was not found in https://repo.maven.apache.org/maven2 during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of central has elapsed or updates are forced

Can you please give an idea to fix this error?
Thanks

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.