reCAPTCHA Enterprise Connector
Use Descope's reCAPTCHA Enterprise connector to enhance the security of your authentication flows. reCAPTCHA Enterprise, a service from Google Cloud, offers comprehensive bot and online fraud protection while allowing legitimate user interactions to proceed smoothly. This guide will walk you through the configuration of the connector and its integration into your application.
How reCAPTCHA Enterprise works
reCAPTCHA Enterprise scores each request in the background, without showing the user a challenge. The check runs in two parts:
- In the browser: The reCAPTCHA Enterprise component on your screen gets a token from Google. When the user submits the screen, the component sends the token to Descope. The token carries no score.
- On the server: The reCAPTCHA Enterprise / Assess action sends the token and the user agent to Google's assessment API. When the flow has them, the action also sends the user's IP address, user ID, email, and phone number. Google returns an assessment with a score from 0.0 (likely a bot) to 1.0 (likely a human).
The Assess action returns Google's assessment unchanged and adds a riskInfo object. If Google rejects the token, the Assess action fails instead of returning a score.
Note
The reCAPTCHA Enterprise Assess action is separate from the built-in Fingerprint Assess action, which uses Cloudflare's bot verdict and needs no connector.
Configuration
Begin by navigating to your Descope dashboard, and access the reCAPTCHA Enterprise connector configuration through: Dashboard -> Connectors -> reCAPTCHA Enterprise.
You will need to fill out the following details:
- Connector Name: Assign a meaningful name to your connector for easy identification among multiple instances.
- Connector Description: Briefly describe the purpose of this connector.
- Project ID: Your Google Cloud project ID where reCAPTCHA Enterprise is enabled.
- Site Key: The site key provided by Google for the reCAPTCHA Enterprise service.
- API Key: The API key associated with your Google Cloud project.
- Base URL: Apply a custom URL to the reCAPTCHA Enterprise scripts. This is useful when attempting to use reCAPTCHA globally. Defaults to https://www.google.com
- Override Assessment: This is related to overriding assessment values when performing end-to-end tests. You should not use this configuration in a production environment. For details about using this configuration, see the section below for override assessment for testing.
- Bot Threshold (0-1): The bot threshold is used to determine whether the request is a bot or a human. The score ranges between 0 and 1, where 1 is a human interaction and 0 is a bot. If the score is below this threshold, the request is considered a bot, and the Assess action sets
riskInfo.botDetectedtotrue. Defaults to 0.5. - Use Static IPs: If enabled, the connector sends its requests to the reCAPTCHA Enterprise API from a predetermined pool of IPs. These IPs are displayed in the UI for you to copy and allow-list on your Google Cloud API key.
Ensure the reCAPTCHA Enterprise API is enabled in your Google Cloud project and you have generated the necessary API key. Refer to Google's documentation for detailed instructions on enabling the API and generating keys.

Integrating reCAPTCHA Enterprise
Screen Component
Incorporate the reCAPTCHA Enterprise Privacy & Terms component in a flow screen. This initiates the CAPTCHA verification setup process for users interacting with your application.

Display options
Select the component on the screen to choose what it displays using the Variant setting:
| Variant | What the user sees |
|---|---|
| Text (default) | The reCAPTCHA notice text, including links to Google's Privacy Policy and Terms of Service. |
| Image | An image you upload, with separate versions for light and dark themes. |
| Widget | A reCAPTCHA badge and logo. |
| Hidden | Nothing. The component is not rendered to the user. |
The Style, Color, Alignment, and Fill container settings apply to the Text variant only. The Image variant offers an image upload instead, and the Hidden variant has no display settings.
Note
The Variant setting only controls what appears on the screen. reCAPTCHA still loads and generates a token regardless of which variant you pick, so the Assess and Annotate steps below behave the same way — including when the variant is Hidden.
In the screen builder, a component set to Hidden appears as a small dashed placeholder so you can still select it and change the variant back. That placeholder is only visible in the builder, never to your users.
Assessment and Annotation
- Assessment: Add an "Assess" block in your flow to make a request to Google reCAPTCHA. This returns data including the user's risk scores. The main risk score (
riskAnalysis.score) determines the likelihood of bot activity, while the SMS risk score (riskInfo.smsRiskScore) specifically evaluates SMS-related fraud risk.
{
"event":{
"expectedAction":"EXPECTED_ACTION",
"hashedAccountId":"ACCOUNT_ID",
"siteKey":"KEY_ID",
"token":"TOKEN",
"userAgent":"(USER-PROVIDED STRING)",
"userIpAddress":"USER_PROVIDED_IP_ADDRESS"
},
"name":"ASSESSMENT_ID",
"riskAnalysis":{
"reasons":[],
"score":"SCORE"
},
"riskInfo": {
"riskScore": "SCORE",
"botDetected": false,
"smsRiskScore": "SCORE"
},
"tokenProperties":{
"action":"USER_INTERACTION",
"createTime":"TIMESTAMP",
"hostname":"HOSTNAME",
"invalidReason":"(ENUM)",
"valid":(BOOLEAN)
}
}
Warning
Since the reCAPTCHA connector runs in the browser, the connector steps need to be added after at least one screen or action component in the flow.
- Annotation: Utilize the "Annotate" block to feed back information about the session (successful or not) to Google. This helps in refining the risk analysis for future sessions. Read more from Google here.
{
'tokenProperties': {
'valid': True,
'hostname': 'www.google.com',
'action': 'homepage',
'createTime': u'2019-03-28T12:24:17.894Z'
},
'riskAnalysis': {
'score': 0.1,
'reasons': ['AUTOMATION']
},
'event': {
'token': 'RESPONSE_TOKEN',
'siteKey': 'KEY_ID'
},
'name': 'ASSESSMENT_ID'
}
Using Assessment Data
The Assess action stores the assessment under the Context Key you set on the action, for example connectors.recaptchaResult. Add a condition after the action to check these values:
| Key | Description |
|---|---|
riskAnalysis.score | Google's bot score, from 0.0 (likely a bot) to 1.0 (likely a human). |
riskAnalysis.reasons | Google's reason codes for the score, such as AUTOMATION or UNEXPECTED_ENVIRONMENT. |
riskInfo.botDetected | true when riskAnalysis.score is below the connector's Bot Threshold. |
riskInfo.smsRiskScore | Google's SMS toll fraud risk, from 0.0 (low risk) to 1.0 (high risk). Higher means riskier, the opposite of riskAnalysis.score. |
The Assess action returns riskInfo.smsRiskScore only when the flow has the user's phone number and you enable SMS Defense in your Google Cloud project.
A common pattern uses three outcomes instead of pass or fail, plus an SMS check if the flow sends SMS:
| Condition | What the flow does |
|---|---|
riskAnalysis.score is 0.7 or higher | Continues to sign-in. |
riskAnalysis.score is 0.3 or higher, and lower than 0.7 | Requires a one-time code by email. |
riskAnalysis.score is lower than 0.3 | Ends the flow. |
riskInfo.smsRiskScore is 0.5 or higher | Skips SMS and uses another method, such as email OTP. |
These thresholds are examples. By default, reCAPTCHA Enterprise returns only four score levels: 0.1, 0.3, 0.7, and 0.9. Google suggests starting at 0.5 and adjusting based on your traffic. See Interpret assessments.

Note
Descope also writes Google's score to riskInfo.riskScore, but you shouldn't check riskInfo.riskScore in flows that use fraud connectors. Check riskAnalysis.score from the reCAPTCHA Enterprise / Assess action instead, for example connectors.recaptchaResult.riskAnalysis.score. See Fraud & Attack Protection.
Example Flow
View an example flow configuration that leverages reCAPTCHA Enterprise for sophisticated risk analysis and fraud prevention in your application.
Check out an example flow on Descope Explorer here.

Override Assessment for Testing
Descope allows you to override the assessment value within the Recaptcha Enterprise connector. Overriding the assessment s helpful in a few scenarios like automated end-to-end testing where you do not want to fail on Recaptcha assessment or testing scenarios where you do want to fail Recaptcha assessment.
To configure the overriding of the Recaptcha assessment within the Recaptcha Enterprise connector configuration, check
the box Override Assessment (For Testing). You can then set the Assessment score; when configured, the Recaptcha action
will return the score without assessing the request. The score ranges between 0 and 1, where 1 is a human interaction, and
0 is a bot.
Additional Resources
For a deeper dive into configuring and utilizing reCAPTCHA Enterprise within Descope, refer to the additional resources and documentation provided by Google Cloud and Descope. These resources offer comprehensive guidance on setting up reCAPTCHA Enterprise for optimal security and fraud prevention in your digital applications.
- reCAPTCHA Enterprise and Descope combine no-code authentication and fraud prevention | Google Cloud Blog
- Connector Spotlight: Fraud Prevention With Descope and Google reCAPTCHA Enterprise
- reCAPTCHA Enterprise overview | Google Cloud
- Comparison of features between reCAPTCHA versions | reCAPTCHA Enterprise | Google Cloud
