2016-08-31 17:53:47 +00:00
|
|
|
[[_cli_recipes]]
|
|
|
|
|
2021-11-10 11:39:43 +00:00
|
|
|
=== CLI recipes
|
2016-08-31 17:53:47 +00:00
|
|
|
Here are some configuration tasks and how to perform them with CLI commands.
|
|
|
|
Note that in all but the first example, we use the wildcard path `**` to mean
|
|
|
|
you should substitute or the path to the keycloak-server subsystem.
|
|
|
|
|
|
|
|
For standalone, this just means:
|
|
|
|
|
|
|
|
`**` = `/subsystem=keycloak-server`
|
|
|
|
|
|
|
|
For domain mode, this would mean something like:
|
|
|
|
|
|
|
|
`**` = `/profile=auth-server-clustered/subsystem=keycloak-server`
|
|
|
|
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Changing the web context of the server
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
/subsystem=keycloak-server/:write-attribute(name=web-context,value=myContext)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Setting the global default theme
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/theme=defaults/:write-attribute(name=default,value=myTheme)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Adding a new SPI and a provider
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/spi=mySPI/:add
|
|
|
|
**/spi=mySPI/provider=myProvider/:add(enabled=true)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Disabling a provider
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/spi=mySPI/provider=myProvider/:write-attribute(name=enabled,value=false)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Changing the default provider for an SPI
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/spi=mySPI/:write-attribute(name=default-provider,value=myProvider)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Configuring the dblock SPI
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/spi=dblock/:add(default-provider=jpa)
|
|
|
|
**/spi=dblock/provider=jpa/:add(properties={lockWaitTimeout => "900"},enabled=true)
|
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Adding or changing a single property value for a provider
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
2017-02-16 09:55:31 +00:00
|
|
|
**/spi=dblock/provider=jpa/:map-put(name=properties,key=lockWaitTimeout,value=3)
|
2016-08-31 17:53:47 +00:00
|
|
|
----
|
|
|
|
==== Remove a single property from a provider
|
|
|
|
[source]
|
|
|
|
----
|
2017-02-16 09:55:31 +00:00
|
|
|
**/spi=dblock/provider=jpa/:map-remove(name=properties,key=lockRecheckTime)
|
2016-08-31 17:53:47 +00:00
|
|
|
----
|
2021-11-10 11:39:43 +00:00
|
|
|
==== Setting values on a provider property of type `List`
|
2016-08-31 17:53:47 +00:00
|
|
|
[source]
|
|
|
|
----
|
|
|
|
**/spi=eventsStore/provider=jpa/:map-put(name=properties,key=exclude-events,value=[EVENT1,EVENT2])
|
|
|
|
----
|