This is a keycloak plugin which implements the keycloak required action SPI. This plugin enables you to have a second terms and conditions (ToS) required action. Sometimes, one has different kind of users in the same realm and need to provide different ToS.
- In order to use this plugin, a ftl file called custom_terms.ftl must be present in your theme. There is no default keycloak theme so this required action won't work if the theme is not ready.
- The plugin is tested with keycloak version 11.0.2
mvn clean package
The repository contains a docker-compose.yml file with a keycloak container and a minimal custom_terms.ftl so you can verify the SPI works as expected:
- Build using
mvn clean package
- Run
cp ./target/custom-terms-and-conditions-0.0.1-SNAPSHOT.jar ./deployments
- Run
docker-compose up
- Open http://localhost:9090 and login using admin/admin
- Navigate to Realm Settings and open tab Login
- Activate option User Registration
- Navigate to Authentication and open tab Required Actions
- Click Register and choose Custom Terms and Conditions
- Enable option Default Action on the registered action
- Open new private browser tab and navigate to http://localhost:9090
To use this required action, copy the jar file into the /standalone/deployments directory. According to the official documentation, hot deployment is possible.