Keycloak
The following describes how to integrate Trustcaptcha into your Keycloak.
Preparation
The following preparations should be made before integrating Trustcaptcha into your Keycloak.
Requirements
- An account with Trustcaptcha and an existing CAPTCHA.
- A Keycloak installation with our plugin, where Trustcaptcha will be integrated.
Supported Keycloak Flows
Keycloak uses flows that you can edit and customize. Trustcaptcha currently supports the following flows:
- Registration
- Login
- Forgot Password
We continuously work on expanding the compatibility of our plugins. If you have any further questions or concerns, feel free to contact our support team.
Installation
Install our Trustcaptcha plugin into your Keycloak installation as follows:
- Download the latest version of our plugin trustcaptcha_keycloak_1-8-0.jar here.
- Copy the file trustcaptcha_keycloak_1-8-0.jar to the providers directory of your Keycloak installation.
Configuration
The following guides and practical video examples show you how to integrate Trustcaptcha into various Keycloak flows.
Registration
The following steps are necessary to integrate Trustcaptcha into your registration flow:
- Log in as an administrator to your Keycloak installation.
- Navigate to Authentication in your realm and then to Flows.
- Duplicate the existing registration flow, give it a new name (e.g., Registration (Trustcaptcha)) and confirm the duplication.
- Click on the top step, then click Add and Add step. Search for Trustcaptcha / Registration Form Action and add this step.
- Position the new Trustcaptcha step at the same level above or below the existing Recaptcha step and then delete the Recaptcha step.
- Open the Settings of the new Trustcaptcha step, set the Alias (e.g., tc-registration), enter your CAPTCHA’s Site Key and Secret Key, and save the settings.
- Finally, click on Actions and then Bind flow. Select the flow type Registration flow and click Save.
- Trustcaptcha is now ready for use in the registration form! 🎉
Login
The following steps are necessary to integrate Trustcaptcha into your login flow:
- Log in as an administrator to your Keycloak installation.
- Navigate to Authentication in your realm and then to Flows.
- Duplicate the existing browser flow, give it a new name (e.g., Browser (Trustcaptcha)) and confirm the duplication.
- Click on Add step. Search for Trustcaptcha / Username Password Form and add this step.
- Position the new Trustcaptcha step at the same level above or below the existing Username Password Form step and then delete the Username Password Form step.
- Open the Settings of the new Trustcaptcha step, set the Alias (e.g., tc-login), enter your CAPTCHA’s Site Key and Secret Key, and save the settings.
- Finally, click on Actions and then Bind flow. Select the flow type Browser flow and click Save.
- Trustcaptcha is now ready for use in the login form! 🎉
Forgot Password
The following steps are necessary to integrate Trustcaptcha into your forgot password flow:
- Log in as an administrator to your Keycloak installation.
- Navigate to Authentication in your realm and then to Flows.
- Duplicate the existing reset credentials flow, give it a new name (e.g., Reset Credentials (Trustcaptcha)) and confirm the duplication.
- Click on Add step. Search for Trustcaptcha / Reset Credentials Choose User and add this step.
- Position the new Trustcaptcha step at the same level above or below the existing Choose User step and then delete the Choose User step.
- Open the Settings of the new Trustcaptcha step, set the Alias (e.g., tc-reset), enter your CAPTCHA’s Site Key and Secret Key, and save the settings.
- Finally, click on Actions and then Bind flow. Select the flow type Reset credentials flow and click Save.
- Trustcaptcha is now ready for use in the forgot password form! 🎉
Template
Trustcaptcha offers two options for frontend integration:
Insert Automatically
With this option, Trustcaptcha automatically integrates into the existing login, registration, and forgot password forms of Keycloak. Trustcaptcha looks for button or input elements with type=submit and integrates itself above them.
Custom Templates
If you don’t use button or input elements with type=submit, or want to customize the CAPTCHA for design reasons, you can disable the Insert Automatically feature in the Trustcaptcha settings. You can then define a div container with the class trustcaptcha in your templates. Trustcaptcha will automatically integrate above this container.