Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Making recaptcha work with a reverse proxy

I am trying to include a recaptcha verification on a 'forgot password' screen for users that are trying to connect to a mobile hotspot. Prior to logging in, they have very limited access through the firewall, and therefore the forgot password screen can't download the js file from the standard script generated by Recaptcha.createRecaptchaHtml:

<script type="text/javascript" src="https://www.google.com/recaptcha/api/challenge?k=...."></script>

I can get around this by changing the src above to point to a local address, and setting up a reverse proxy to forward it to google.

However, this call downloads an additional javascript (https://www.google.com/recaptcha/api/js/recaptcha.js) file that contains more references to google (and I believe other sites as well) that the page cannot reach.

Question: Has anyone tried to do something like this, and is there an elegant solution? If not, I will resort to a simpler captcha solution that requires fewer firewall changes.

like image 281
pierus Avatar asked Jul 10 '14 18:07

pierus


People also ask

How can I integrate reCAPTCHA in my site?

Add Google reCAPTCHA to a formClick the pencil icon or Edit on the form or newsletter block. In the Storage tab, click Google reCAPTCHA. Switch the Use Google reCAPTCHA toggle on. Repeat these steps for all form blocks on your site where you want to add a reCAPTCHA.

Why is reCAPTCHA blocking me?

reCAPTCHA support Unfortunately it may happen to good users like you for a few reasons: You may be on a shared network that is being used abusively. Your internet service provider may have recently assigned you a suspicious IP address. The site you are trying to access may be currently under heavy attack.

Does reCAPTCHA v3 stop bots?

While reCAPTCHA v2 and v3 can help block some bot traffic, they cannot stop advanced scalper bots, scraper bots, DDoS, ATO attacks, etc.

How do I fix reCAPTCHA verification failed?

Help for reCAPTCHA usersMake sure your browser is fully updated (see minimum browser requirements) Check that JavaScript is enabled in your browser. Try disabling plugins that might conflict with reCAPTCHA.


1 Answers

For anyone still wondering, I ended up using a lighter-weight captcha solution that did not require additional calls.

like image 142
pierus Avatar answered Sep 19 '22 20:09

pierus