Added instructions on deploying provider examples using jboss-cli
This commit is contained in:
parent
bdbb1b891a
commit
5f0b3ae019
5 changed files with 36 additions and 6 deletions
|
@ -99,7 +99,7 @@ public class MyEventListenerProvider implements EventListenerProvider {
|
|||
script or manually create a folder inside KEYCLOAK_HOME/modules and add your jar and a <literal>module.xml</literal>.
|
||||
For example to add the event listener sysout example provider using the jboss-cli script execute:
|
||||
<programlisting><![CDATA[{
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-sysout --resources=event-listener-sysout-example.jar"
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-sysout --resources=target/event-listener-sysout-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-model-api,org.keycloak.keycloak-events-api"
|
||||
}]]></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>
|
||||
|
|
|
@ -1,7 +1,17 @@
|
|||
Example Event Listener that prints events to System.out
|
||||
=======================================================
|
||||
|
||||
To deploy copy target/event-listener-sysout-example.jar to standalone/configuration/providers.
|
||||
To deploy copy target/event-listener-sysout-example.jar to standalone/configuration/providers. Alternatively you can deploy as a module by running:
|
||||
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-sysout --resources=target/event-listener-sysout-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-model-api,org.keycloak.keycloak-events-api"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.event-sysout"
|
||||
],
|
||||
|
||||
Then start (or restart) the server. Once started open the admin console, select your realm, then click on Events,
|
||||
followed by config. Click on Listeners select box, then pick sysout from the dropdown. After this try to logout and
|
||||
login again to see events printed to System.out.
|
||||
|
|
|
@ -1,7 +1,16 @@
|
|||
Example Event Store that stores events in memory
|
||||
================================================
|
||||
|
||||
To deploy copy target/event-store-mem-example.jar to standalone/configuration/providers.
|
||||
To deploy copy target/event-store-mem-example.jar to standalone/configuration/providers. Alternatively you can deploy as a module by running:
|
||||
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.event-inmem --resources=target/event-store-mem-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-model-api,org.keycloak.keycloak-events-api"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.event-inmem"
|
||||
],
|
||||
|
||||
Then edit standalone/configuration/keycloak-server.json, change:
|
||||
|
||||
|
|
|
@ -59,7 +59,7 @@ public class MemEventStoreProvider implements EventStoreProvider {
|
|||
|
||||
@Override
|
||||
public void onEvent(Event event) {
|
||||
if (!excludedEvents.contains(event.getType())) {
|
||||
if (excludedEvents == null || !excludedEvents.contains(event.getType())) {
|
||||
events.add(0, event);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -2,7 +2,18 @@ Example User Federation Provider
|
|||
===================================================
|
||||
|
||||
This is an example of user federation backed by a simple properties file. This properties file only contains username/password
|
||||
key pairs. To deploy, build this directory then take the jar and copy it to standalone/configuration/providers.
|
||||
key pairs. To deploy, build this directory then take the jar and copy it to standalone/configuration/providers. Alternatively you can deploy as a module by running:
|
||||
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.userprops --resources=target/federation-properties-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-model-api"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.userprops"
|
||||
],
|
||||
|
||||
|
||||
You will then have to restart the authentication server.
|
||||
|
||||
The ClasspathPropertiesFederationProvider is an example of a readonly provider. If you go to the Users/Federation
|
||||
|
@ -13,4 +24,4 @@ a "test-users.properties" within the JAR that you can use as the variable.
|
|||
The FilePropertiesFederationProvider is an example of a writable provider. It synchronizes changes made to
|
||||
username and password with the properties file. If you go to the Users/Federation page of the admin console you will
|
||||
see this provider listed under "file-properties". To configure this provider you specify a fully qualified file path to
|
||||
a properties file in the "path" field of the admin page for this plugin.
|
||||
a properties file in the "path" field of the admin page for this plugin.
|
||||
|
|
Loading…
Reference in a new issue