0

I have implemented RECAPCHA on my login page using this tutorial and it works great. It makes use of the AspNetCore.ReCaptcha package.

The issue that I'm having is that the recaptcha needs a file named recaptcha__en.js that lives outside, in a Google repository.

I'm working in a VPN that I need to use to connect to my client network, and this VPN blocks the connection to this outside .js. To unblock it or add a specific rule in the VPN, is not an option right now, so I was wondering if there's any way to tell the recaptcha html .NET core component, to read the recaptcha__en.js from my own solution.

I tried to simply include the script in my page, but the component still fails. It insists on searching for the JS outside, even if it is included in the page. If there's a way, it isn't documented anywhere that I'm aware off.

Can you help?

Ken White
  • 123,280
  • 14
  • 225
  • 444
SamyCode
  • 928
  • 3
  • 14
  • 33

1 Answers1

0

I don't know if you can visit other websites in your VPN at all.

If you can access other sites, you can use reCAPTCHA globally. Using https://www.recaptcha.net/recaptcha/api.js will work fine in your internal network.

If you can't access any sites in your VPN, you can't use reCAPTCHA service in your project, because the Javascript content like https://www.google.com/recaptcha/api.js are not static functions in a file. It's an interactive Google service.

Ken White
  • 123,280
  • 14
  • 225
  • 444
Jason Pan
  • 15,263
  • 1
  • 14
  • 29
  • Hay Jason, thank you for your answer. My VPN allows me to access other sites, and I can confirm that I have access to that link you provided, than you. The problem here is that the library I'm using, provides me a .NET Core html component in which, for what I know until now, I have no control of from where it reads the JS. I mean, I can include that link within a script tag, but I have no control at all about from where the component is actually connecting. The HTML component seems to insists to connect to the original external .js and ignores my script tag. – SamyCode Nov 09 '21 at 14:12
  • @SamyCode This post should be useful to you. https://stackoverflow.com/questions/3232904/using-recaptcha-on-localhost – Jason Pan Nov 10 '21 at 01:34