Protects Keycloak browser login, self-registration, and reset-password forms with a Captchala challenge, verified server-side.
- Keycloak: 26.5.6+ (Quarkus). Java 17.
- Render mode: floating widget (
float, default) orpopup. - Server-side verification: the plugin mints a one-time
server_tokenand validates the returnedpass_tokenagainst the Captchala API.
cd keycloak-plugin
mvn clean package
# -> target/keycloak-captchala-1.0.0.jar- Copy the JAR into Keycloak:
cp target/keycloak-captchala-1.0.0.jar /opt/keycloak/providers/ /opt/keycloak/bin/kc.sh build
- Restart Keycloak.
- Select the login theme: Realm settings → Themes → Login theme →
captchala.
You need a Captchala App Key and App Secret (dashboard → your app).
- Authentication → Flows, duplicate the browser flow.
- In the forms sub-flow, replace Username Password Form with Captchala Username Password Form (REQUIRED).
- Click the gear icon → set
App Key,App Secret, and any overrides. - Action → Bind flow → Browser flow.
- Duplicate the registration flow.
- In the registration form sub-flow, add execution Captchala Registration (REQUIRED).
- Gear icon → set
App Key/App Secret. - Bind as the realm Registration flow.
- Duplicate the reset credentials flow.
- Replace Choose User with Captchala Reset Credential (choose user) (REQUIRED).
- Gear icon → set
App Key/App Secret. - Bind as the realm Reset credentials flow.
| Key | Default | Notes |
|---|---|---|
app.key |
— | Public app key |
app.secret |
— | Private app secret (masked) |
product |
float |
float or popup |
action |
per flow | login / register / reset |
language |
realm locale | Widget language |
fail.closed |
true |
Deny when the API is unreachable |
use.server.token |
true |
Mint a one-time server token at render |
- On render, the provider mints a
server_token(POST /v1/server/challenge/issue) and injects the widget config. - The user solves the floating widget; the SDK returns a
pass_token. - On submit, the provider validates it (
POST /v1/validate,keep_token:false); onlydata.valid(ordata.degraded) continues the flow.