Cloudflare Turnstile test page · Special cases
Cloudflare Turnstile login form demo
This page is a sign-in form protected by a Cloudflare Turnstile widget with the action login, built the way real sites build them. Nothing you type is sent or kept: only the widget's token goes to the check, which asks Cloudflare's siteverify for its verdict.
The sign-in form
LivePoint your solver here
- websiteURL
- https://zerocaptcha.io/captcha-test/cloudflare-turnstile-login-form
- websiteKey
- 0x4AAAAAAFMVDQUY9ZAPO0ni
- metadata
- action loginA site that checks them refuses a token solved without them.
- type
- TurnstileTaskProxyless$0.40 per 1,000 solved. With your proxy, TurnstileTask: $0.40.
Charged only when the token is ready. A failed task costs $0.
This widget's settings
- Mode
- managed
- Appearance
- always
- Size
- normal
- Rendering
- implicit
- Action
- login
The verdict
The token goes to this site's API, which asks Cloudflare's siteverify with the widget's secret key. The reply is shown as it came.
No token checked yet
Sign in once the widget has a token, or paste a token a task returned for this page.
- success
- not checked yet
- hostname
- not checked yet
- challenge_ts
- not checked yet
- action
- not checked yet
- cdata
- not checked yet
- error-codes
- not checked yet
- Widget
- not checked yet
- Round trip
- not checked yet
What the error codes mean
The token you checked
The API
Solve this page with the API
The complete createTask request for this page, then getTaskResult every 2 seconds until it is ready, then the result used as the page uses it. Set ZEROCAPTCHA_KEY to your API key.
- type
- TurnstileTaskProxyless, or TurnstileTask with your proxy
- websiteURL
- https://zerocaptcha.io/captcha-test/cloudflare-turnstile-login-form
- websiteKey
- 0x4AAAAAAFMVDQUY9ZAPO0ni
- metadata.action
- login
- metadata.cdata
- This widget sets none
- proxy
- Only with TurnstileTask: http://user:pass@host:port
- callbackUrl
- Optional: called with the result when the task ends
- Idempotency-Key
- A header: sent again within 24 hours, it returns the first task
A task is charged at the listed price when it succeeds; a failed one costs nothing. The same task over REST, POST /v1/tasks, is in Solving Cloudflare Turnstile.
#!/usr/bin/env bash
# Solve this page's Cloudflare Turnstile widget with createTask, then check the token here.
set -euo pipefail
API=${ZEROCAPTCHA_API:-https://api.zerocaptcha.io}
KEY=${ZEROCAPTCHA_KEY:?Set ZEROCAPTCHA_KEY to your API key, zc_live_..., from the dashboard.}
# 1. createTask for this page and its sitekey.
# metadata holds this widget's data-action and data-cdata: a site that checks them
# refuses a token solved without them, so copy them from the widget you solve.
# To solve through your own proxy, make the type TurnstileTask and add
# proxy: "http://user:pass@proxy.example.net:8080" to the task.
# CALLBACK_URL, when set, is called with the result when the task ends.
BODY=$(jq -n --arg key "$KEY" --arg callback "${CALLBACK_URL:-}" '{
clientKey: $key,
task: {
type: "TurnstileTaskProxyless",
websiteURL: "https://zerocaptcha.io/captcha-test/cloudflare-turnstile-login-form",
websiteKey: "0x4AAAAAAFMVDQUY9ZAPO0ni",
metadata: {action: "login"}
},
callbackUrl: (if $callback == "" then null else $callback end)
}')
CREATED=$(curl -sS --fail-with-body "$API/createTask" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: $(uuidgen)" \
-d "$BODY")
# errorId 1 is a refusal: errorCode and errorDescription say why.
if [ "$(jq -r .errorId <<<"$CREATED")" != 0 ]; then echo "$CREATED" >&2; exit 1; fi
TASK_ID=$(jq -r .taskId <<<"$CREATED")
# 2. getTaskResult every 2 seconds until the task is ready; errorId 1 means it failed, unpaid.
while :; do
sleep 2
RESULT=$(curl -sS --fail-with-body "$API/getTaskResult" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg key "$KEY" --arg id "$TASK_ID" '{clientKey: $key, taskId: $id}')")
if [ "$(jq -r .errorId <<<"$RESULT")" != 0 ]; then echo "$RESULT" >&2; exit 1; fi
if [ "$(jq -r .status <<<"$RESULT")" = ready ]; then break; fi
done
TOKEN=$(jq -r .solution.token <<<"$RESULT")
# 3. Use solution.token once, within 300 seconds: here, this page's check, which asks
# Cloudflare's siteverify. Or paste it into the token box on the page.
curl -sS --fail-with-body "$API/v1/demo/verify" \
-H "Content-Type: application/json" \
-d "$(jq -n --arg token "$TOKEN" '{widget: "managed", token: $token}')"
# Solve this page's Cloudflare Turnstile widget with createTask, then check the token here.
import os
import sys
import time
import uuid
import requests
API = os.environ.get("ZEROCAPTCHA_API", "https://api.zerocaptcha.io")
KEY = os.environ.get("ZEROCAPTCHA_KEY") or sys.exit("Set ZEROCAPTCHA_KEY to your API key, zc_live_..., from the dashboard.")
def post(path, body, headers=None):
"""POSTs JSON to the API: the reply, or an exit with the reason it was refused."""
reply = requests.post(f"{API}{path}", json=body, headers=headers or {}, timeout=30)
reply.raise_for_status()
data = reply.json()
if data.get("errorId"):
sys.exit(f"{data['errorCode']}: {data['errorDescription']}")
return data
# 1. createTask for this page and its sitekey.
created = post(
"/createTask",
{
"clientKey": KEY,
"task": {
"type": "TurnstileTaskProxyless", # or "TurnstileTask", with "proxy" below
"websiteURL": "https://zerocaptcha.io/captcha-test/cloudflare-turnstile-login-form",
"websiteKey": "0x4AAAAAAFMVDQUY9ZAPO0ni",
# This widget's data-action and data-cdata: a site that checks them refuses a token
# solved without them, so copy them from the widget you solve.
"metadata": {"action": "login"},
# "proxy": "http://user:pass@proxy.example.net:8080", # TurnstileTask only
},
# Optional: called with the result when the task ends.
"callbackUrl": os.environ.get("CALLBACK_URL"),
},
headers={"Idempotency-Key": str(uuid.uuid4())},
)
# 2. getTaskResult every 2 seconds until the task is ready; a failed one exits, unpaid.
while True:
time.sleep(2)
result = post("/getTaskResult", {"clientKey": KEY, "taskId": created["taskId"]})
if result["status"] == "ready":
break
# 3. Use solution.token once, within 300 seconds: here, this page's check, which asks
# Cloudflare's siteverify. Or paste it into the token box on the page.
verdict = post("/v1/demo/verify", {"widget": "managed", "token": result["solution"]["token"]})
print(verdict["success"], verdict["hostname"], verdict["action"], verdict["cdata"], verdict["errorCodes"])
// Solve this page's Cloudflare Turnstile widget with createTask, then check the token here.
const API = process.env.ZEROCAPTCHA_API || "https://api.zerocaptcha.io";
const KEY = process.env.ZEROCAPTCHA_KEY;
if (!KEY) throw new Error("Set ZEROCAPTCHA_KEY to your API key, zc_live_..., from the dashboard.");
/** POSTs JSON to the API: the reply, or an error with the reason it was refused. */
async function post(path, body, headers = {}) {
const reply = await fetch(`${API}${path}`, {
method: "POST",
headers: { "Content-Type": "application/json", ...headers },
body: JSON.stringify(body),
});
if (!reply.ok) throw new Error(`${path}: HTTP ${reply.status}: ${await reply.text()}`);
const data = await reply.json();
if (data.errorId) throw new Error(`${data.errorCode}: ${data.errorDescription}`);
return data;
}
// 1. createTask for this page and its sitekey.
const { taskId } = await post(
"/createTask",
{
clientKey: KEY,
task: {
type: "TurnstileTaskProxyless", // or "TurnstileTask", with proxy below
websiteURL: "https://zerocaptcha.io/captcha-test/cloudflare-turnstile-login-form",
websiteKey: "0x4AAAAAAFMVDQUY9ZAPO0ni",
// This widget's data-action and data-cdata: a site that checks them refuses a token
// solved without them, so copy them from the widget you solve.
metadata: { action: "login" },
// proxy: "http://user:pass@proxy.example.net:8080", // TurnstileTask only
},
// Optional: called with the result when the task ends.
callbackUrl: process.env.CALLBACK_URL,
},
{ "Idempotency-Key": crypto.randomUUID() },
);
// 2. getTaskResult every 2 seconds until the task is ready; a failed one throws, unpaid.
let result;
do {
await new Promise((resolve) => setTimeout(resolve, 2000));
result = await post("/getTaskResult", { clientKey: KEY, taskId });
} while (result.status === "processing");
// 3. Use solution.token once, within 300 seconds: here, this page's check, which asks
// Cloudflare's siteverify. Or paste it into the token box on the page.
const verdict = await post("/v1/demo/verify", { widget: "managed", token: result.solution.token });
console.log(verdict.success, verdict.hostname, verdict.action, verdict.cdata, verdict.errorCodes);
- File
- turnstile.sh 47 lines
- Needs
- bash, curl, jq and uuidgen
- Run
bash turnstile.sh
- File
- turnstile.py 54 lines
- Needs
- Python 3.10 or later and the requests package
- Run
python turnstile.py
- File
- turnstile.mjs 50 lines
- Needs
- Node.js 22 or later
- Run
node turnstile.mjs
About this widget
What this widget is
Login forms are among the most common places to meet Cloudflare Turnstile. The widget sits between the password field and the button, and the form sends its token with the email and password. The site's server checks the token with siteverify before it looks at the password.
Automating a sign-in you are allowed to automate is two steps: get a token for the form, then send the form with it, as the browser would.
Bring a token from elsewhere: the Cloudflare Turnstile token checker.
How to use the result
Send the token in the form's request, in the cf-turnstile-response field, with the email and password. On this page the form sends only the token, to the check beside it.
A token passes siteverify once, within 300 seconds of the solve. Solve again for each sign-in attempt.
How to recognise it on a real site
- A
cf-turnstileelement inside the sign-in form, usually withdata-action="login", and acf-turnstile-responsefield in the form's request when it is sent. - The page loads
https://challenges.cloudflare.com/turnstile/v0/api.js, the only script Cloudflare supports: it must not be copied, proxied or cached. - The widget itself is an iframe from challenges.cloudflare.com, under
/cdn-cgi/challenge-platform/. Its requests go to Cloudflare, never to the site. - Inside a form, the widget adds a hidden input named
cf-turnstile-responseand puts the token there. The site's server checks it with POSThttps://challenges.cloudflare.com/turnstile/v0/siteverify. - No cookie is set on the site's own domain: the widget's state lives in Cloudflare's iframe.
<script src="https://challenges.cloudflare.com/turnstile/v0/api.js" async defer></script>
<div class="cf-turnstile" data-sitekey="0x4AAAAAAFMVDQUY9ZAPO0ni" data-action="login"></div>
<!-- once solved: <input type="hidden" name="cf-turnstile-response" value="…"> -->Which ZeroCaptcha task solves the Cloudflare Turnstile widget on a login form?
TurnstileTaskProxyless, or TurnstileTask to solve through your own proxy, with the page's URL and its sitekey, plus action and cdata when the widget sets them. The same task solves every Cloudflare Turnstile widget, whatever its mode or appearance.
Is my password sent anywhere by this demo?
No. The email and password fields are for show: the page sends only the widget's token to the check, and nothing is kept.
ZeroCaptcha You build. We solve.
Point a task at this page
Create an account, add $10 and run your first task.