Problem/Motivation

There is currently no option in the configuration page to select project id and score to support Enterprise invisible Captcha

There should be option to support Enterprise reCAPTCHA

Steps to reproduce

Navigate to admin/config/people/captcha/recaptcha
add v3 captcha and use enterprise key captcha will not come and validate

Proposed resolution

I am attaching all patch file to supporting Enterprise reCAPTCHA apply this patch and test
Add a checkbox in the config page with label: Use Enterprise JS and a textfield for the Enterprise Project ID.
This will determine the Javascript API to be loaded - https://www.google.com/recaptcha/api.js for Free version; https://www.google.com/recaptcha/enterprise.js for Enterprise version. Project ID is the ID of the Google Cloud project for which the reCAPTCHA_V3 Enterprise API is enabled.

Remaining tasks

User interface changes

after create field we need to provide project id and set score 0.5

Introduced terminology

API changes

api url change https://www.google.com/recaptcha/enterprise.js

Data model changes

Release notes snippet

Comments

imran2734 created an issue. See original summary.

imran2734’s picture

Issue summary: View changes
StatusFileSize
new4.76 KB
imran2734’s picture

avpaderno’s picture

Version: 2.0.4 » 2.0.x-dev
Category: Support request » Task
Priority: Major » Normal
Status: Needs review » Needs work
Issue tags: -reCAPTCHA v3 +Needs merge request

Since patches are no longer tested, a merge request needs to be provided.

imran2734’s picture

update patch with all file and tested it is working for me

dench0’s picture

@imran2734
Why do we need this new setting: recaptcha_is_human_score? It looks like we already have it in the action config.

dench0’s picture

And possibly better to use the official Google package instead of the custom Enterprise class: https://github.com/googleapis/google-cloud-php-recaptcha-enterprise

imran2734’s picture

yes we can use

imran2734’s picture

using custom enterprise.php file we are calling rest api if i will use library https://github.com/googleapis/google-cloud-php-recaptcha-enterprise it is asking some json file i need to upload in my directory we don't want to upload any json file .

dench0’s picture

That library can fetch the API key from different locations: like JSON file, ENV variable...

You can find an example of passing the API key by this link https://cloud.google.com/recaptcha/docs/create-assessment-website#create...

imran2734’s picture

Multiple approach is there so I am going with this approach POST https://recaptchaenterprise.googleapis.com/v1/projects/PROJECT_ID/assess...

Here we need to pass project id and API_KEY to get validate token response,.

We’ll continue monitoring the official package for future improvements, but for now, our custom implementation meets the project’s requirements without introducing additional credential handling overhead.

ericvl’s picture

IMHO, I think both of this and this issue are duplicates of eachother. Look to the steps that are allready made in the other issue.

imran2734’s picture

yes both issue is same but here i am providing complete patch file

imran2734’s picture

Status: Needs work » Needs review
avpaderno’s picture

Status: Needs review » Needs work

Patches are no longer tested; they should no longer be provided. drupal.org now uses merge requests, which is provided by the other issue.

It is useless to have two issues for the same task.

avpaderno’s picture

Status: Needs work » Closed (duplicate)
Issue tags: -Needs merge request
Related issues: +#3500825: Add support for reCAPTCHA Enterprise

This issue can now be closed as duplicate of #3500825: Add support for reCAPTCHA Enterprise.

Now that this issue is closed, please review the contribution record.

As a contributor, attribute any organization helped you, or if you volunteered your own time.

Maintainers, please credit people who helped resolve this issue.