Open Closed

Google reCAPTCHA always returns a low score when running locally #9881


User avatar
0
LiSong created

Works correctly in production server, but in local development environment, siteverify always returns a low score, causing validation to fail with error message: ** Verification failed, score below threshold**

I have added localhost in the domain list on the google reCAPTCHA key page


5 Answer(s)
  • User Avatar
    0
    AI-Bot created
    Support Team ABP Agent
    • Google reCAPTCHA v3 scores can be lower in local development environments, even if "localhost" is added to the allowed domains. This is a known behavior and is not specific to ABP. Google’s scoring algorithm may treat local traffic as less trustworthy, especially if requests are automated or lack real user interaction.

    • In production, real user activity and proper domain validation typically result in higher scores. For local development, you can consider lowering the score threshold in your ABP reCAPTCHA configuration to allow testing, but be sure to restore the recommended threshold for production.

    • To adjust the threshold in ABP, set the AbpReCaptchaOptions.ScoreThreshold to a lower value in your development environment:

    Configure<AbpReCaptchaOptions>(options =>
      {
          options.ScoreThreshold = 0.1f; // Lower for local testing
      });
    
    • Always use your actual site key and secret, and ensure you are not using test keys in production.

    • For more details on enabling and configuring reCAPTCHA in ABP, see the official support answer:

      • https://abp.io/support/questions/489
    • Google’s official documentation:

      • https://www.google.com/recaptcha/about/
      • https://www.google.com/recaptcha/admin

    Sources:

    • https://abp.io/support/questions/489
    • https://www.google.com/recaptcha/about/
    • https://www.google.com/recaptcha/admin

    This response was generated by AI. If it didn’t solve your problem, feel free to post a new answer — our support team will jump in to help you soon.

  • User Avatar
    0
    LiSong created

    ok, but AbpReCaptchaOptions could not be found

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi What is your reCAPTCHA mode? V2 V3? What is your VerifyBaseUrl?

    Can you test your reCAPTCHA by https://github.com/maliming/reCAPTCHA/tree/master/demo/reCAPTCHA.Demo

    Thanks.

  • User Avatar
    0
    LiSong created

    what's VerifyBaseUrl? I am using v3 and do we need to set up the Site key and Site secret for each tenant? it's working in production, but it doesn't work in my local

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    You can use your key and secret in the Demo project to check it locally.

    https://github.com/maliming/reCAPTCHA/blob/master/demo/reCAPTCHA.Demo/Startup.cs#L24-L29

Learn More, Pay Less
33% OFF
All Trainings!
Get Your Deal
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v10.0.0-preview. Updated on September 10, 2025, 06:30