You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
To install the keycloak-kafka module to your keycloak server you have to first configure the module and then deploy the module.
28
+
If you deploy the module without configuration your keycloak server will fail to start up with a NullPointerException.
27
29
28
-
Add a new provider in `standalone.xml` under `<subsystem xmlns="urn:jboss:domain:keycloak-server:1.1">`.
30
+
If you want to install the module manually as described in the initial version you can follow this [guide](https://github.com/SnuK87/keycloak-kafka/wiki/Manual-Installation).
Download the .jar files listed under `<resources>` from [MVN Repository](https://mvnrepository.com/) and put them into the same folder.
32
+
### Module configuration
33
+
Download the [CLI script](kafka-module.cli) from this repository and edit the properties to fit your environment. Also make sure that you use the right
34
+
server config (line 1). As a default the script will change the `standalone.xml`.
78
35
79
-
```
80
-
.
81
-
├── kafka-clients-2.2.0.jar
82
-
├── lz4-java-1.5.0.jar
83
-
├── module.xml
84
-
├── snappy-java-1.1.7.2.jar
85
-
└── zstd-jni-1.3.8-1.jar
86
-
```
87
-
88
-
## Configuration
89
-
90
-
### Enable Events in keycloak
91
-
1. Open administration console
92
-
2. Choose realm
93
-
3. Go to Events
94
-
4. Open `Config` tab and add `kafka` to Event Listeners. If you can't choose `kafka` you have to restart the keycloak server first.
95
-
96
-
97
-
### Kafka module
98
-
Add the following content to your `standalone.xml`:
Currently the following properties are available and should be changed to fit your environemnt:
113
37
114
38
`topicEvents`: The name of the kafka topic to where the events will be produced to.
115
39
@@ -121,21 +45,31 @@ Add the following content to your `standalone.xml`:
121
45
122
46
`topicAdminEvents`: (Optional) The name of the kafka topic to where the admin events will be produced to.
123
47
124
-
125
-
To automate the configuration of the event listener, it is possible to run the [CLI script](kafka-module.cli) from this repo.
126
-
Make sure to edit the properties to fit your environemnt and use the right server config (default is `standalone-ha`)
127
-
48
+
Run the CLI script using the following command and check the output on the console. You should see some server logs and 6 lines of `{"outcome" => "success"}`.
The simplest way to enable the kafka module in a docker container is to create a custom docker image from the keycloak base image and use the CLI script to configure the kafka module.
134
-
First all .jar files must be added to the image and placed in their module directory as explained in [Installation](#installation). Then the CLI script must be added and placed in
135
-
the `/opt/jboss/startup-scripts/` directory, so the script will be executed automatically on startup.
53
+
### Module deployment
54
+
Copy the `keycloak-kafka-<version>-jar-with-dependencies.jar` into the $KEYCLOAK_HOME/standalone/deployments folder. Keycloak will automatically
55
+
install the module with all dependencies on start up. To verify that the deployment of the module was successful you can check if a new file
56
+
with the name `keycloak-kafka-<version>-jar-with-dependencies.jar.deployed` was created in the same folder.
57
+
136
58
137
-
An example can be found in this [Dockerfile](Dockerfile).
59
+
## Keycloak Configuration
138
60
61
+
### Enable Events in keycloak
62
+
1. Open administration console
63
+
2. Choose realm
64
+
3. Go to Events
65
+
4. Open `Config` tab and add `kafka` to Event Listeners.
66
+
67
+
68
+
## Docker Container
69
+
The simplest way to enable the kafka module in a docker container is to create a custom docker image from the [keycloak base image](https://hub.docker.com/r/jboss/keycloak/).
70
+
The `keycloak-kafka-<version>-jar-with-dependencies.jar` must be added to the `/standalone/deployments` folder and the CLI script must be added to the `/opt/jboss/startup-scripts/` folder
71
+
as explained in [Installation](#installation). The only difference is that the CLI script will be executed automatically in start up and doesn't have to be executed manually.
72
+
An example can be found in this [Dockerfile](Dockerfile).
0 commit comments