diff --git a/docbook/reference/en/en-US/modules/providers.xml b/docbook/reference/en/en-US/modules/providers.xml index 4e2239dcbd..e88bc34e2a 100755 --- a/docbook/reference/en/en-US/modules/providers.xml +++ b/docbook/reference/en/en-US/modules/providers.xml @@ -87,33 +87,69 @@ public class MyEventListenerProvider implements EventListenerProvider {
Registering provider implementations - Keycloak loads provider implementations from the file-system. By default all JARs inside - standalone/configuration/providers are loaded. This is simple, but requires all providers - to share the same library. All provides also inherit all classes from the Keycloak class-loader. In the future - we'll add support to load providers from modules, which allows better control of class isolation. + Keycloak can load provider implementations from JBoss Modules or directly from the file-system. Using Modules + is recommended as you can control exactly what classes are available to your provider. Any providers loaded + from the file-system uses a classloader with the Keycloak classloader as its parent. - - To register your provider simply copy the JAR including the ProviderFactory and Provider classes and the - provider configuration file to standalone/configuration/providers. - - - You can also define multiple provider class-path if you want to create isolated class-loaders. To do this - edit keycloak-server.json and add more classpath entries to the providers array. For example: + +
+ Register a provider using Modules + + To register a provider using Modules first create a module. To do this you have to 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 create the folder KEYCLOAK_HOME/modules/org/keycloak/examples/event-sysout/main. + Copy event-listener-sysout-example.jar to this folder and create module.xml + with the following content: + + + + + + + + + + + +}]]> + Next you need to register this module with Keycloak. This is done by editing keycloak-server.json and adding + it to the providers: + + +
+ + +
+ Register a provider using file-system + + To register your provider simply copy the JAR including the ProviderFactory and Provider classes and the + provider configuration file to standalone/configuration/providers. + + + You can also define multiple provider class-path if you want to create isolated class-loaders. To do this + edit keycloak-server.json and add more classpath entries to the providers array. For example: - The above example will create two separate class-loaders for providers. The classpath entries follow the - same syntax as Java classpath, with ';' separating multiple-entries. Wildcard is also supported allowing - loading all jars (files with .jar or .JAR extension) in a folder, for example: + The above example will create two separate class-loaders for providers. The classpath entries follow the + same syntax as Java classpath, with ';' separating multiple-entries. Wildcard is also supported allowing + loading all jars (files with .jar or .JAR extension) in a folder, for example: - + +