{"duration_api_ms":10492,"stop_reason":"end_turn","session_id":"ed5e46d4-6fab-4828-9e52-c20b85f5e288","total_cost_usd":0.0330182,"usage":{"input_tokens":2,"cache_creation_input_tokens":4951,"cache_read_input_tokens":6902,"output_tokens":1252,"output_tokens_details":{"thinking_tokens":487},"server_tool_use":{"web_search_requests":0,"web_fetch_requests":0},"service_tier":"standard","cache_creation":{"ephemeral_1h_input_tokens":4951,"ephemeral_5m_input_tokens":0},"inference_geo":"global","iterations":[{"input_tokens":2,"output_tokens":1252,"cache_read_input_tokens":6902,"cache_creation_input_tokens":4951,"cache_creation":{"ephemeral_5m_input_tokens":0,"ephemeral_1h_input_tokens":4951},"type":"message"}],"speed":"standard","fallback_credit":null},"modelUsage":{"claude-sonnet-5-5":{"inputTokens":2,"outputTokens":1252,"cacheReadInputTokens":6902,"cacheCreationInputTokens":4951,"webSearchRequests":0,"costUSD":0.0330182,"contextWindow":1000000,"maxOutputTokens":128000,"thinkingTokens":487,"canonicalModel":"claude-sonnet-5-5","provider":"firstParty","costBasis":"list"}},"permission_denials":[],"terminal_reason":"completed","fast_mode_state":"off","fast_mode_disabled_reason":"sdk_opt_in_required","subagent_stats":{"spawned":0,"requested":{"background":0,"foreground":0,"unset":0},"started_in_background":0,"max_depth":0,"spawned_by_subagents":0,"completed":0,"failed":0,"killed":{"parent":0,"user":0,"system":0},"refused":{"depth_limit":0,"concurrency_limit":0,"budget":0},"by_type":{}},"safety_stops":0,"is_error":false,"num_turns":1,"subtype":"success","api_error_status":null,"result":"These steps are from memory of the Keycloak admin console (v20+ UI). Exact labels may differ slightly between versions.\n\n**1. Get keys from Google**\n- In the Google reCAPTCHA admin console, create a site using **reCAPTCHA v2 (\"I'm not a robot\" checkbox)**.\n- Add your Keycloak hostname as a domain.\n- Copy the **site key** and **secret key**.\n- Keycloak's built-in action is the v2 one. I'm not sure about v3 support, so check your version's docs if you want v3.\n\n**2. Copy the registration flow**\n- In the Admin Console, select your realm and go to **Authentication → Flows**.\n- Built-in flows can't be edited, so open the **registration** flow's kebab menu and choose **Duplicate**. Name it, for example, `registration-captcha`.\n\n**3. Add the execution**\n- In the copy, find the **\"registration form\"** subflow (its full name is `<your flow name> registration form`).\n- Click **+ → Add step**, choose **Recaptcha** (provider `registration-recaptcha-action`), and click **Add**.\n- Set its requirement to **Required**.\n\n**4. Configure the execution**\n- Click the **gear icon** on the Recaptcha row.\n- Enter an alias, the **Recaptcha Site Key** and the **Recaptcha Secret Key**, then click **Save**.\n- Depending on your version, there may also be a **Use recaptcha.net** toggle. I'm not certain of the other options.\n\n**5. Bind the new flow**\n- At the top right of the flow, choose **Action → Bind flow**, select **Registration flow**, and save.\n\n**6. Make sure registration is enabled**\n- Go to **Realm settings → Login** and turn **User registration** on.\n\n**Things to check**\n- Registration uses your realm's login theme. The default themes render the captcha. A custom theme's `register.ftl` must include the reCAPTCHA widget and script, or nothing will appear.\n- If the widget is blocked, check **Realm settings → Security defenses → Content-Security-Policy**. It may need to allow Google's domains (`https://www.google.com`, or `recaptcha.net` if you enabled that option) for frames and scripts. I'm not sure whether the default policy already allows them in your version.","ttft_ms":5282,"type":"result","duration_ms":10765,"uuid":"7c0c39ab-9d9d-4a3b-b927-2676d0934992","ttft_stream_ms":1200,"time_to_request_ms":270,"first_content_frame_ms":1200,"queued_turn_count":0,"result_index":0}
