2014-08-04 16:25:11 +00:00
|
|
|
Example User Federation Provider
|
|
|
|
===================================================
|
|
|
|
|
|
|
|
This is an example of user federation backed by a simple properties file. This properties file only contains username/password
|
2016-04-06 11:18:23 +00:00
|
|
|
key pairs. To deploy, build this directory then take the jar and copy it to providers directory. Alternatively you can deploy as a module by running:
|
2015-04-01 12:22:17 +00:00
|
|
|
|
2016-02-04 08:17:44 +00:00
|
|
|
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-server-spi"
|
2015-04-01 12:22:17 +00:00
|
|
|
|
2016-09-08 12:04:12 +00:00
|
|
|
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
2015-04-01 12:22:17 +00:00
|
|
|
|
2016-09-08 12:04:12 +00:00
|
|
|
<providers>
|
|
|
|
...
|
|
|
|
<provider>module:org.keycloak.examples.userprops</provider>
|
|
|
|
</providers>
|
2015-04-01 12:22:17 +00:00
|
|
|
|
2015-01-28 09:48:26 +00:00
|
|
|
You will then have to restart the authentication server.
|
2014-08-04 16:25:11 +00:00
|
|
|
|
|
|
|
The ClasspathPropertiesFederationProvider is an example of a readonly provider. If you go to the Users/Federation
|
|
|
|
page of the admin console you will see this provider listed under "classpath-properties. To configure this provider you
|
|
|
|
specify a classpath to a properties file in the "path" field of the admin page for this plugin. This example includes
|
|
|
|
a "test-users.properties" within the JAR that you can use as the variable.
|
|
|
|
|
2014-08-20 15:08:40 +00:00
|
|
|
The FilePropertiesFederationProvider is an example of a writable provider. It synchronizes changes made to
|
2014-08-04 16:25:11 +00:00
|
|
|
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
|
2015-04-01 12:22:17 +00:00
|
|
|
a properties file in the "path" field of the admin page for this plugin.
|