Merge pull request #3215 from stianst/KEYCLOAK-3538
KEYCLOAK-3538 Update examples to refer to standalone.xml for config
This commit is contained in:
commit
df5d37a8d9
8 changed files with 57 additions and 57 deletions
|
@ -6,13 +6,12 @@ of Keycloak. To deploy, build this directory then take the jar and copy it to
|
|||
|
||||
KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.secret-question --resources=target/authenticator-required-action-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,org.keycloak.keycloak-services,org.jboss.resteasy.resteasy-jaxrs,javax.ws.rs.api"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.secret-question"
|
||||
],
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.secret-question</provider>
|
||||
</providers>
|
||||
|
||||
You then have to copy the secret-question.ftl and secret-question-config.ftl files to the themes/base/login directory.
|
||||
|
||||
|
|
|
@ -6,12 +6,12 @@ To run, deploy as a module by running:
|
|||
$KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.domain-extension-example --resources=target/domain-extension-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-services,org.keycloak.keycloak-model-jpa,org.keycloak.keycloak-server-spi,javax.ws.rs.api,javax.persistence.api,org.hibernate,org.javassist"
|
||||
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.domain-extension-example"
|
||||
],
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.domain-extension-example</provider>
|
||||
</providers>
|
||||
|
||||
Then start (or restart) the server.
|
||||
|
||||
|
|
|
@ -5,23 +5,25 @@ To deploy copy target/event-listener-sysout-example.jar to providers directory.
|
|||
|
||||
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-server-spi"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.event-sysout"
|
||||
],
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.event-sysout</provider>
|
||||
</providers>
|
||||
|
||||
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.
|
||||
|
||||
The example event listener can be configured to exclude certain events, for example to exclude REFRESH_TOKEN and
|
||||
CODE_TO_TOKEN events add the following to keycloak-server.json:
|
||||
CODE_TO_TOKEN events add the following to `standalone.xml`:
|
||||
|
||||
...
|
||||
"eventsListener": {
|
||||
"sysout": {
|
||||
"exclude": [ "REFRESH_TOKEN", "CODE_TO_TOKEN" ]
|
||||
}
|
||||
}
|
||||
<spi name="eventsListener">
|
||||
<provider name="sysout">
|
||||
<properties>
|
||||
<property name="exclude-events" value="["REFRESH_TOKEN", "CODE_TO_TOKEN"]"/>
|
||||
</properties>
|
||||
</provider
|
||||
</spi>
|
||||
|
|
|
@ -5,24 +5,24 @@ To deploy copy target/event-store-mem-example.jar to providers directory. Altern
|
|||
|
||||
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-server-spi"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.event-inmem"
|
||||
],
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.event-inmem</provider>
|
||||
</providers>
|
||||
|
||||
Then edit standalone/configuration/keycloak-server.json, change:
|
||||
Then edit `standalone/configuration/standalone.xml`, change:
|
||||
|
||||
"eventsStore": {
|
||||
"provider": "jpa"
|
||||
}
|
||||
<spi name="eventsStore">
|
||||
<default-provider>jpa</default-provider>
|
||||
</spi>
|
||||
|
||||
to:
|
||||
|
||||
"eventsStore": {
|
||||
"provider": "in-mem"
|
||||
}
|
||||
<spi name="eventsStore">
|
||||
<default-provider>in-mem</default-provider>
|
||||
</spi>
|
||||
|
||||
Then start (or restart)the server. Once started open the admin console, select your realm, then click on Events,
|
||||
followed by config. Set the toggle for Enabled to ON. After this try to logout and login again then open the Events tab
|
||||
|
|
|
@ -6,13 +6,12 @@ key pairs. To deploy, build this directory then take the jar and copy it to pro
|
|||
|
||||
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"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.userprops"
|
||||
],
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.userprops</provider>
|
||||
</providers>
|
||||
|
||||
You will then have to restart the authentication server.
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ public abstract class BasePropertiesFederationFactory implements UserFederationP
|
|||
}
|
||||
|
||||
/**
|
||||
* You can import additional plugin configuration from keycloak-server.json here.
|
||||
* You can import additional plugin configuration from standalone.xml here.
|
||||
*
|
||||
* @param config
|
||||
*/
|
||||
|
|
|
@ -5,12 +5,12 @@ To deploy copy target/hello-rest-example.jar to providers directory. Alternative
|
|||
|
||||
$KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.examples.hello-rest-example --resources=target/hello-rest-example.jar --dependencies=org.keycloak.keycloak-core,org.keycloak.keycloak-server-spi,javax.ws.rs.api"
|
||||
|
||||
Then registering the provider by editing keycloak-server.json and adding the module to the providers field:
|
||||
Then registering the provider by editing `standalone/configuration/standalone.xml` and adding the module to the providers element:
|
||||
|
||||
"providers": [
|
||||
....
|
||||
"module:org.keycloak.examples.hello-rest-example"
|
||||
],
|
||||
<providers>
|
||||
...
|
||||
<provider>module:org.keycloak.examples.hello-rest-example</provider>
|
||||
</providers>
|
||||
|
||||
Then start (or restart) the server. Once started open http://localhost:8080/realms/master/hello and you should see the message _Hello master_.
|
||||
You can also invoke the endpoint for other realms by replacing `master` with the realm name in the above url.
|
|
@ -17,14 +17,14 @@ Alternatively you can deploy as modules. This can be done by first running:
|
|||
mvn clean install
|
||||
$KEYCLOAK_HOME/bin/jboss-cli.sh --command="module add --name=org.keycloak.example.themes --resources=target/keycloak-example-themes.jar"
|
||||
|
||||
Then open $KEYCLOAK_HOME/standalone/configuration/keycloak-server.json and register the theme module by adding:
|
||||
|
||||
"theme": {
|
||||
"module": {
|
||||
"modules": [ "org.keycloak.example.themes" ]
|
||||
}
|
||||
}
|
||||
Then open `standalone/configuration/standalone.xml` and register the theme module by adding:
|
||||
|
||||
<theme>
|
||||
...
|
||||
<modules>
|
||||
<module>org.keycloak.example.themes</module>
|
||||
</modules>
|
||||
</theme>
|
||||
|
||||
Address Theme
|
||||
-------------------
|
||||
|
@ -45,11 +45,11 @@ Change Logo Theme
|
|||
|
||||
To enable the theme open the admin console, select your realm, click on `Theme`. In the dropdowns for `Login Theme`, `Account Theme` and `Admin Console Theme` select `logo-example`. Click `Save` and login to the realm to see the new theme in action.
|
||||
|
||||
To change the theme for the welcome pages open `standalone/configuration/keycloak-server.json` find the config for `theme` and add 'welcomeTheme':
|
||||
To change the theme for the welcome pages open `standalone/configuration/standalone.xml` find the config for `theme` and add 'welcomeTheme':
|
||||
|
||||
"theme": {
|
||||
<theme>
|
||||
...
|
||||
"welcomeTheme": "logo-example"
|
||||
},
|
||||
<welcomeTheme>logo-example</welcomeTheme>
|
||||
</theme>
|
||||
|
||||
One thing to note is that to change the admin console for the master admin console (`/auth/admin`) you need to change the theme for the master realm. Changing the admin console theme for any other realms will only change the admin console for that specific realm (for example `/auth/admin/myrealm/console`).
|
||||
|
|
Loading…
Reference in a new issue