Discuss Scratch

46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

First, go to the Google reCAPTCHA Admin Console and log in to your Google account or create one if you haven't already. This assumes you aren't logged in.
Fill out the form and select reCAPTCHA v2. You must also select the “I'm not a robot” Checkbox option.
Enter the domains and any other necessary information in the form. For a localhost domain such as localhost:8080, type localhost.
You are given a site key and a secret key. The webpage should be in HTML5. The following code should be placed anywhere in the page:
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
The following code should be placed in the body of the document inside a form with a POST method.
<div class=“g-recaptcha” data-sitekey="your_site_key"></div>
I apologize for the quotes around g-recaptcha looking like “ and ” instead of “ and ” (Oh, these quotes got changed too).
Replace your_site_key with the site key that was given. You can always refer to it later.
Once the form is submitted, the browser must execute a PHP script that does the following:

Check if it is a POST request. If so, do this:
First, get the value of the POST parameter g-recaptcha-response.
Next, send a POST request to https://www.google.com/recaptcha/api/siteverify with the parameter secret as the secret key that was provided earlier (like the site key, you can always check it later) and the parameter response as the value received earlier for the POST parameter g-recaptcha-response.
Once the request is received, decode it into/parse it as a JSON object.
Finally, check the JSON object parsed just earlier and check if the value of the parameter success in the object equals true. If so, the reCAPTCHA is solved!

Last edited by 46009361 (April 24, 2021 00:26:48)

Capitan_Florida_2
Scratcher
100+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

what does this have to do with scratch
46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

I meant to put it here: https://scratch.mit.edu/discuss/30/
MegaApuTurkUltra
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

i'd advise against using google recaptcha

it's basically mandatory user tracking for google, and it forces people to do unpaid image recognition work to train google AI (in other words, slave labor)

even worse, it fundamentally bars people who may be disabled from using your website, because in my experience clicking the “audio captcha” button always gives some generic error

many, many other captcha solutions exist that aren't literally the definition of evil
xn--cr8h
New Scratcher
48 posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

99% of problems that recaptcha tries to solve can also be solved by rolling your own captcha that isn't hopelessly overengineered
LastContinue
Scratcher
500+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

xn--cr8h wrote:

99% of problems that recaptcha tries to solve can also be solved by rolling your own captcha that isn't hopelessly overengineered
I personally like to force users to mine 1000 valid shares of Monero before letting them past, as a time delay system, but also means if anyone then goes to the lengths of trying to bruteforce my systems at an efficient speed, they are compensating me in the process, even if they don't get in.

Shame how Coinhive shut down.

MegaApuTurkUltra wrote:

i'd advise against using google recaptcha

it's basically mandatory user tracking for google, and it forces people to do unpaid image recognition work to train google AI (in other words, slave labor)

even worse, it fundamentally bars people who may be disabled from using your website, because in my experience clicking the “audio captcha” button always gives some generic error

many, many other captcha solutions exist that aren't literally the definition of evil

How do you feel about hcaptcha? (Apart from the fact it looks like a full on scam of course ) If we ignore the crypto gimmick that it's trying to be, would something like this be good, in your books?



game_pr0grammer
Scratcher
500+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

MegaApuTurkUltra wrote:

basically mandatory user tracking for google, and it forces people to do unpaid image recognition work to train google AI (in other words, slave labor)

What do you mean “unpaid”? It does pay you–access to something.
Sheep_maker
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

game_pr0grammer wrote:

MegaApuTurkUltra wrote:

basically mandatory user tracking for google, and it forces people to do unpaid image recognition work to train google AI (in other words, slave labor)

What do you mean “unpaid”? It does pay you–access to something.
Slaves were also paid food and shelter; the difference is that normal work is voluntary
LastContinue
Scratcher
500+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

game_pr0grammer wrote:

MegaApuTurkUltra wrote:

basically mandatory user tracking for google, and it forces people to do unpaid image recognition work to train google AI (in other words, slave labor)

What do you mean “unpaid”? It does pay you–access to something.
'Tisn't Google giving the access, but rather the site owner.
That would be like saying slaves are paid because international charities provide them with basic living necessities…
46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

Well, you only need
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
and a variation of
<div class=“g-recaptcha” data-sitekey=“6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI”></div>
LastContinue
Scratcher
500+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

46009361 wrote:

Well, you only need
<script src="https://www.google.com/recaptcha/api.js" async defer></script>
and a variation of
<div class=“g-recaptcha” data-sitekey=“6LeIxAcTAAAAAJcZVRqyHh71UMIEGNQ_MXjiZKhI”></div>
Yes but you're still giving your visitors information - most of who will be none-the-wiser - to the Anti-Consumer MegaCorp that is Alphabet Inc.

Last edited by Paddle2See (April 24, 2021 02:05:52)

MegaApuTurkUltra
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

also this is kind of a tangent but i think having automatic registration on your site is a bad idea in general

i'm more for models where humans manually review each registration, or your site is just entirely invite-only
46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

Bump.
Saturates
Scratcher
100+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

46009361 wrote:

Bump.
A bump after 2 years??
46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

Saturates wrote:

46009361 wrote:

Bump.
A bump after 2 years??
Yeah! Looks like a Scratch Team member moved it to the right forum; this was originally in Advanced Topics.
mythic_mew
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

46009361 wrote:

Saturates wrote:

46009361 wrote:

Bump.
A bump after 2 years??
Yeah! Looks like a Scratch Team member moved it to the right forum; this was originally in Advanced Topics.
this is for video games and books?!?!?!?!?!?
46009361
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

Bump.
leapstartgo
Scratcher
3 posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

hi
DifferentDance8
Scratcher
1000+ posts

How to add reCAPTCHA v2 "I'm not a robot" checkbox to your site

Reported this to move either to the ATs again, or to TiMaC. This subsection is for movies, TV shows, books, and other things (code not being one of them)

Powered by DjangoBB