6.2.2. Register a provider using Modules
To register a provider using Modules first create a module. To do this you can either use the jboss-cli script or manually create a folder inside KEYCLOAK_HOME/modules
and add your jar and a module.xml
. For example to add the event listener sysout example provider using the jboss-cli
script execute:
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.acme.provider --resources=target/provider.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi"
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.acme.provider --resources=target/provider.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi"
Or to manually create it start by creating the folder KEYCLOAK_HOME/modules/org/acme/provider/main
. Then copy provider.jar
to this folder and create module.xml
with the following content:
Once you’ve created the module you need to register this module with Red Hat Single Sign-On. This is done by editing the keycloak-server subsystem section of standalone.xml
, standalone-ha.xml
, or domain.xml
, and adding it to the providers: