KEYCLOAK-1125 Update provider documentation and example and add instructions on using jboss-cli to create module
This commit is contained in:
parent
fcc2e0a9f0
commit
969b1bf33c
1 changed files with 12 additions and 6 deletions
|
@ -95,10 +95,14 @@ public class MyEventListenerProvider implements EventListenerProvider {
|
||||||
<section>
|
<section>
|
||||||
<title>Register a provider using Modules</title>
|
<title>Register a provider using Modules</title>
|
||||||
<para>
|
<para>
|
||||||
To register a provider using Modules first create a module. To do this you have to create a folder inside
|
To register a provider using Modules first create a module. To do this you can either use the jboss-cli
|
||||||
KEYCLOAK_HOME/modules and add your jar and a <literal>module.xml</literal>. For example to add the event listener
|
script or manually create a folder inside KEYCLOAK_HOME/modules and add your jar and a <literal>module.xml</literal>.
|
||||||
sysout example provider create the folder <literal>KEYCLOAK_HOME/modules/org/keycloak/examples/event-sysout/main</literal>.
|
For example to add the event listener sysout example provider using the jboss-cli script execute:
|
||||||
Copy <literal>event-listener-sysout-example.jar</literal> to this folder and create <literal>module.xml</literal>
|
<programlisting><![CDATA[{
|
||||||
|
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-sysout --resources=event-listener-sysout-example.jar"
|
||||||
|
}]]></programlisting>
|
||||||
|
Or to manually create it start by creating the folder <literal>KEYCLOAK_HOME/modules/org/keycloak/examples/event-sysout/main</literal>.
|
||||||
|
Then copy <literal>event-listener-sysout-example.jar</literal> to this folder and create <literal>module.xml</literal>
|
||||||
with the following content:
|
with the following content:
|
||||||
<programlisting><![CDATA[{
|
<programlisting><![CDATA[{
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
@ -113,8 +117,10 @@ public class MyEventListenerProvider implements EventListenerProvider {
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</module>
|
</module>
|
||||||
}]]></programlisting>
|
}]]></programlisting>
|
||||||
Next you need to register this module with Keycloak. This is done by editing keycloak-server.json and adding
|
</para>
|
||||||
it to the providers:
|
<para>
|
||||||
|
Once you've created the module you need to register this module with Keycloak. This is done by editing
|
||||||
|
keycloak-server.json and adding it to the providers:
|
||||||
<programlisting><![CDATA[{
|
<programlisting><![CDATA[{
|
||||||
"providers": [
|
"providers": [
|
||||||
...
|
...
|
||||||
|
|
Loading…
Reference in a new issue