Simple Machines Community Forum

SMF Support => SMF 2.1.x Support => Topic started by: landyvlad on January 21, 2019, 06:50:37 AM

Title: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 21, 2019, 06:50:37 AM
I decided to give reCAPTCHA  try so I followed the relevant link and set it up for reCAPTCHA v3.

I entered the public and private keys into the relevant boxes in the SMF anit spam - recaptcha admin area.  And saved.

Someone attempted to register and got (the attached)

Suggestions?

My test site: http://www.gsx1400owners.org/test21forum




Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Arantor on January 21, 2019, 07:42:04 AM
Use reCAPTCHA v2
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: live627 on January 21, 2019, 05:23:35 PM
Your keys must be for v2 of the api. I've only tried the checkbox type, since that's the one I used when I integrated it.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Antes on January 21, 2019, 05:43:18 PM
Quote from: live627 on January 21, 2019, 05:23:35 PM
Your keys must be for v2 of the api. I've only tried the checkbox type, since that's the one I used when I integrated it.

Maybe a small language change to state that SMF using v2.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 21, 2019, 07:09:18 PM
Thanks

I've now changed it to recaptcha v2 keys so hopefully it works now.

Feel free to try for me :)
http://www.gsx1400owners.org/test21forum/
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 21, 2019, 08:46:06 PM
Hmm seems to have got worse.  Went with a V2 setup and now get this...

Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Dzonny on January 22, 2019, 07:11:46 AM
Quote from: landyvlad on January 21, 2019, 08:46:06 PM
Hmm seems to have got worse.  Went with a V2 setup and now get this...


I can see captcha image and checkbox there, but I can also see the input field below which I'm not sure what's there for.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Shambles on January 22, 2019, 07:47:09 AM
Quote from: Dzonny
I can see captcha image and checkbox there, but I can also see the input field below which I'm not sure what's there for.

I believe that's being discussed in the reCaptcha mod support thread, to do with setting questions in conjunction with reCaptcha.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Illori on January 22, 2019, 07:51:48 AM
SMF 2.1 has recaptcha by default, so it is not using the mod.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 22, 2019, 05:39:40 PM
Yes correct 2.1 has it by default.

Dzonny - thanks. Someone else had the same result - see attachment - I presume that's what you are seeing too ?

I'm wondering if that's where the verification question is supposed to appear.

Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: live627 on January 22, 2019, 05:55:48 PM
This pull request may be related

https://github.com/SimpleMachines/SMF2.1/pull/5358
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: lurkalot on January 22, 2019, 05:57:26 PM
Quote from: landyvlad on January 22, 2019, 05:39:40 PM
Yes correct 2.1 has it by default.

Dzonny - thanks. Someone else had the same result - see attachment - I presume that's what you are seeing too ?

I'm wondering if that's where the verification question is supposed to appear.

I also had this very same thing. 

Yes that's where the verification question is when it's working.  On my test site the that text entry box was showing without the question, even though the number of verification to show was set to 0.  The only way to get rid of that rogue entry box was to delete the question(s) and save.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: lurkalot on January 22, 2019, 06:20:02 PM
Just managed to get it to do it again.  Screenshot, one showing the extra entry box, but no question, and one showing the setting.

Again the only way to get rid of that entry box was to remove the question and answer. And save.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Arantor on January 22, 2019, 06:27:29 PM
Check it isn't the intentional hidden input showing.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: live627 on January 22, 2019, 06:41:04 PM
I looked at the site of landyvlad.  The hidden input works as expected. The element in question is

<input type="text" name="register_vv[q][]" size="30" value="" tabindex="8" required="">
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 22, 2019, 07:04:55 PM
live627 - I don't understand that at all, but I assume it wasn't directed at me anyway, :) but to others who may be able to help resolve the issue.

Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: live627 on January 22, 2019, 09:04:48 PM
That's right.


As I posted in reply #10, a fix is in the worsts,
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Sesquipedalian on January 23, 2019, 03:07:53 PM
The fix that live627 linked to above has been merged.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 23, 2019, 07:22:50 PM
when was it merged.

About 12 hours ago I updated my test forum with latest nightly from  https://www.simplemachines.org/community/index.php?topic=558451.20

The behaviour continues as before - badly :D - so apparently hasn't been sorted yet.

Be good when it is, because it's a pretty major issue if there are problems with members trying to register.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 23, 2019, 10:54:10 PM
further to the above post - I'm told that if a registering user waits long enough they get this.

The theory that has been proposed is that it might have something to do with https... ?

So does the actual forum need to be HTTPS before recaptcha will work?
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 23, 2019, 11:06:16 PM
I accessed the forum using as https link.

I was able to click the recaptcha and get the tick.

As you can see though there is still a : where there should be a question (1) and a blank response field (2)
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Sesquipedalian on January 24, 2019, 12:53:51 AM
Quote from: landyvlad on January 23, 2019, 07:22:50 PM
About 12 hours ago I updated my test forum with latest nightly from  https://www.simplemachines.org/community/index.php?topic=558451.20

Quote from: Sesquipedalian on January 24, 2019, 12:46:16 AM
Quote from: landyvlad on January 23, 2019, 07:30:12 PM
Ok well I've marked this as "not solv4ed" because 12 hours ago I upgraded my test forum to the latest nightly version, and this behaviour is continuing to occur:

Quote
   Type of error: Undefined

8: Undefined offset: 1
http://www.gsx1400owners.org/test21forum/index.php?action=signup2
/home/gsxowner/public_html/test21forum/Themes/default/GenericControls.template.php (Line 252)
   

Guest
Today at 03:49 am
86.141.5.231
836e3a79517b027159d4b69246cb05ac


Type of error: Undefined

8: Undefined offset: 1
http://www.gsx1400owners.org/test21forum/index.php?action=signup2
/home/gsxowner/public_html/test21forum/Themes/default/GenericControls.template.php (Line 251) 

If you are still getting references to lines 251 and 252, then you are not using the latest version from GitHub.

My guess is that albertlast's nightly build hadn't yet incorporated the latest changes by the time you downloaded.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: albertlast on January 24, 2019, 01:01:26 AM
reason why i recommand to provide the last_commit_* file name,
so that person from the support know which github version is used.

Quote
Also in this version it's important when you provide bugs,
which "version" you use ther for you find a file in the root called "last_commit_<version>" exp: last_commit_de7e49,
so when you open a bug/issue/request provide this number or even better update first to last version.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Sesquipedalian on January 24, 2019, 09:40:38 AM
Indeed.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 27, 2019, 06:14:16 AM
Thanks I'll have another crack
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on January 27, 2019, 07:58:52 PM
OK just upgraded and can confirm that - as at Last Commit 4fa7e97  - Recaptcha (v2) in combination with the security questions, is working perfectly !
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: Sesquipedalian on January 27, 2019, 10:19:18 PM
Excellent. Glad to hear it.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: TurtleKicker on March 07, 2019, 06:56:20 PM
This seemed the best thread to ask this question:

Is there a technical issue that prevents reCaptcha v3 from being used in SMF 2.1? It seems it would be preferable, as it's less annoying to users.

Or is there something undesirable regarding v3 resulting in a deliberate choice to not use it and only support v2?

Just curious. I have it (v2) working at the moment. Thanks!
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: live627 on March 07, 2019, 08:25:31 PM
I wrote and tested it for v2, the latest at the time.
Title: Re: How to get ReCAPTCHA to work in SMF 2.1 ?
Post by: landyvlad on March 08, 2019, 12:23:02 AM
annoying to users? Ticking one box?

If that annoys them to much they'd probably never post in a forum anyway....