Was this helpful?
How to solve reCAPTCHA Enterprise V2 on app.oneassembly.com using Python
Introduction
This guide is for developers who need to automatically solve reCAPTCHA Enterprise V2 on Auth0-protected login pages. You will learn how to correctly pass session-dependent parameters, avoid the ERROR_CAPTCHA_UNSOLVABLE error, and get working tokens through the API.
What you should know: basic understanding of HTTP requests, REST APIs, and asynchronous programming in Python.
Getting started
About reCAPTCHA Enterprise V2
reCAPTCHA Enterprise is Google's advanced version of reCAPTCHA, built for business-critical use cases. Compared to the standard v2, the Enterprise version:
- Requires the
enterprise=1parameter in your solver API request - May use extra parameters like
action,data-s,apiDomain - Often appears on high-security pages, including Auth0-based login flows
Auth0 session specifics
Auth0 login pages generate unique URLs with a state parameter, for example:
https://login.oneassembly.com/u/login?state=hKFo2SB1MTFkY2IyWnN6cEtwMVZ5WkloWlFCTXJvNlc0VXp1VKFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIEdWTDZIeElIU0RGZHV6SG9NMWpVdk1wMmM3Q1R0bjNSo2NpZNkgSnNOTlAwM3pxTDZVQUJjZHlncXFhczZySlpTdmduNzY
This parameter ties the session to a specific browser and IP address. If you send the solver a base URL like https://app.oneassembly.com, it will not see the captcha form and will return ERROR_CAPTCHA_UNSOLVABLE.
Key takeaway: always pass the full dynamic URL with all session parameters in the pageurl field.
Setting up your environment
Installing dependencies
You will need:
- Python 3.7 or newer
- The
twocaptchalibrary
Install the package via pip:
bash
pip install twocaptcha
Getting your API key
- Sign up on our website
- Go to your account settings
- Copy your API key
- For security, store the key in an environment variable:
bash
# Linux/macOS
export APIKEY_2captcha.com=your_key_here
# Windows (CMD)
set APIKEY_2captcha.com=your_key_here
Analyzing the page
Step 1. Open the login page
Go to the starting URL: https://app.oneassembly.com. You will be automatically redirected to login.oneassembly.com with a state parameter.
Step 2. Open developer tools
Press F12, switch to the Network tab. Refresh the page and look for a request to anchor (this loads the reCAPTCHA widget).
Step 3. Extract the parameters
In the anchor request, find these parameters:
| Parameter | Where to find it | Example value |
|---|---|---|
k (sitekey) |
Query string of the anchor request | 6LeSRLUpAAAAAFjsCw4WqcgzM6imNrz2rSS4l_I1 |
co (origin) |
Query string | https://app.oneassembly.com:443 |
apiDomain |
Query string (optional) | www.recaptcha.net |
Note: the data-s parameter is not required for this case.
Implementation
Here is a complete working example in Python using the async twocaptcha client.
python
import asyncio
import os
import sys
# Add the library path if installed locally
sys.path.append(os.path.dirname(os.path.dirname(os.path.realpath(__file__))))
from twocaptcha import AsyncTwoCaptcha
# Get API key from environment variable or set directly (not recommended for production)
api_key = os.getenv('APIKEY_2captcha.com', 'YOUR_API_KEY')
# Solver configuration
config = {
'server': '2captcha.com', # or 'rucaptcha.com' for alternative server
'apiKey': api_key,
'softId': 123, # Your software ID (optional, for stats)
'defaultTimeout': 120, # Timeout for regular requests, in seconds
'recaptchaTimeout': 600, # Timeout specifically for reCAPTCHA, in seconds
'pollingInterval': 10, # Result polling interval, in seconds
}
# Initialize async client
solver = AsyncTwoCaptcha(**config)
async def solve_recaptcha_enterprise():
"""
Solves reCAPTCHA Enterprise V2 for Auth0 page oneassembly.com
"""
try:
result = await solver.recaptcha(
sitekey='6LeSRLUpAAAAAFjsCw4WqcgzM6imNrz2rSS4l_I1',
# Critical: pass the full URL with the state parameter
url='https://login.oneassembly.com/u/login?state=hKFo2SAyc2M1dldxTjhMS19TYV9kb2MxM0hCdjJ6MWdWbXZ5dqFur3VuaXZlcnNhbC1sb2dpbqN0aWTZIHdFREliaWgyRXNzSkFsUjVvcHFyVllnYU5sVHp4bHhUo2NpZNkgSnNOTlAwM3pxTDZVQUJjZHlncXFhczZySlpTdmduNzY',
enterprise=1, # Required for Enterprise version
invisible=0, # 0 = checkbox, 1 = invisible captcha
action='', # Optional, if widget does not require action
# apiDomain='www.recaptcha.net', # Can be set, but not required
# Proxies not required for testing, but recommended for production:
# proxy={'type': 'HTTPS', 'uri': 'login:pass@ip:port'}
)
return result
except Exception as e:
print(f'Error during captcha solving: {e}')
sys.exit(1)
if __name__ == '__main__':
# Run the async function
result = asyncio.run(solve_recaptcha_enterprise())
# Output the result: response code and token (or error code)
print('Result:', result)
Code walkthrough
Use the received token in the standard way for reCAPTCHA.
recaptcha request parameters
python
result = await solver.recaptcha(
sitekey='...',
url='https://login.oneassembly.com/u/login?state=...',
enterprise=1,
invisible=0,
...
)
sitekey: the widget's public key, extracted from theanchorrequest.url: the full dynamic URL with the state parameter. This is the key to success.enterprise=1: required flag for the Enterprise version. Without it, the task will be processed as a regular reCAPTCHA v2, which will cause an error.invisible=0: indicates a checkbox widget, not an invisible captcha.
Error handling
The try/except block catches network exceptions, timeouts, and parameter validation errors. In production, add retry logic and proper logging.
Common issues
| Error | Likely cause | Fix |
|---|---|---|
ERROR_CAPTCHA_UNSOLVABLE |
Base URL sent instead of dynamic URL with state | Use the full URL from the address bar after the Auth0 redirect |
ERROR_WRONG_USER_KEY |
Invalid API key | Check your key in account settings on 2captcha.com |
ERROR_ZERO_BALANCE |
Insufficient account balance | Top up your balance or check if you hit a limit |
ERROR_IP_NOT_ALLOWED |
Request from unauthorized IP | Add the IP to the allowlist in your API key settings |
| Token rejected by the site | User-Agent mismatch or missing proxy | Use the same User-Agent as your browser, add a residential proxy from the target location |
| Slow solving (>5 min) | Captcha requires updated parameters | Make sure pageurl is current, refresh the state before each request if needed |
Extra resources
-
Sandbox: enable sandbox
Test API requests without writing code -
Python SDK docs: reCAPTCHA Enterprise V2 in the 2captcha-python repo
Library method details and usage examples fortwocaptcha -
API documentation: reCAPTCHA V2 Enterprise
Full endpoint specs and method parameters -
Support: open a ticket
Contact support for technical questions
Pre-launch checklist
- API key obtained and verified
-
twocaptchalibrary installed (pip install twocaptcha) -
sitekeyextracted -
urlparameter contains the full dynamic URL, not just the base domain -
enterprise=1flag is set -
invisibleparameter matches the widget type - Residential proxies from the target location are configured for production
- User-Agent in requests matches the browser
- Exceptions are handled and error logging is in place
- Tested in sandbox before production launch
Final thoughts
Solving reCAPTCHA Enterprise V2 on Auth0 pages means paying attention to details: dynamic session parameters, correct API flags, and a consistent environment. Follow this guide, and you will reliably get working tokens and integrate captcha solving into your projects with confidence.