• Resolved studioam2

    (@studioam2)


    Hello,

    we have newest wordpress and newest version of CF7 on site starprof.pl. We generated new site with correct domain in recaptcha v3 admin console, after that we copy generated keys into Contact -> Integration section. In google cloud console in recaptcha section we still have information like this:

    Backend ->
    Not completed
    Complete key setup: request results To fully protect your site or app, complete the key setup. Your key requests tokens (execution) but not results (evaluation).

    https://ibb.co/SdhxYGk

    How to make it work? We did everythink correct with incruction here -> https://contactform7.com/recaptcha/

    In our other site (fosfan.pl) we have different problem, also with backend section in google cloud recaptcha service:

    https://ibb.co/BCKHg4v

    Backend ->
    No protection
    Your key not applicable in search results Your token (execution) derivation key but was not released in the last results (ratings) release. Something is misconfigured in the backend environment. Your website or app isn’t protected because you’re not blocking suspicious activity.

    How to make this work too? Any help? Why its not working and we have errors in google cloud recaptcha console?

    The page I need help with: [log in to see the link]

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Takayuki Miyoshi

    (@takayukister)

    Where on the site do you have the form having the issue?

    Thread Starter studioam2

    (@studioam2)

    Hello Takayuki.

    We have CF7 on that page: http://starprof.pl/kontakt/

    We see information about not completed configuration (Your key requests tokens (execution) but not results (evaluation).) in google cloud console in recaptcha section, but we did everything like in instruction. Domain and keys in contact -> integration -> recaptcha v3 are correct…

    Plugin Author Takayuki Miyoshi

    (@takayukister)

    As far as I can see from the frontend, reCAPTCHA is working correctly.

    Thread Starter studioam2

    (@studioam2)

    Unfortunately Google Cloud Console still show us key status: incomplete, look at 3 last sites marked with grey icon status:
    https://ibb.co/gt6dFcz

    In details we seeinformation like this:
    https://ibb.co/ZSkNNNm

    Translating from polish to english:

    Complete Key Setup: Request Results To fully protect your site or app, complete key setup. Your key requests tokens (execution), but not results (rating).

    How can we change key like this and get those results requests?

    Our configuration looks ok, but problem still persist, check screens below:
    https://ibb.co/Xt41VQ2
    https://ibb.co/R2R3w3Q

    Thread Starter studioam2

    (@studioam2)

    Exactly message which we get from google cloud console is:
    Finish setting up your key: Request scores

    To fully protect your site or app, finish setting up your key. Your key is requesting tokens (executes), but isn’t requesting scores (assessments).

    Thread Starter studioam2

    (@studioam2)

    Sorry for spam. Issue fixed.

    What helped us?:
    We deleted previous keys and generated new ones.

    After You enter public and private key You must get at least one try to send email by contact form 7, even if it will be error, score went to google cloud platform. So You must take action manually, there is no auto verification request results (without making at least 1 try sending email by contact form 7).

    In summary status changed from incomplete to protected with green icon.

    Everythink working correctly now.

    I have what seems to be this problem, ongoing — in the “Configuration” list on Google Cloud – reCAPTCHA > Key details > Overview, the message (for the “Backend” section):

    "Incomplete Finish setting up your key: Request scores To fully protect your site or app, finish setting up your key. Your key is requesting tokens (executes), but isn't requesting scores (assessments)."

    I tried deleting the keys and generating new ones (as recommended above), but the alert notice is still there.

    I’ve also sent messages (successfully) via CF7.

    The reCAPTCHA configuration is quite opaque, but I don’t know if it is that, or something to do with CF7.

    Anyone have the faintest clue?

    UPDATE: the error has resolved at Google Cloud reCAPTCHA, though I still get a browser console error saying:

    Failed to load resource: the server responded with a status of 401 (Unauthorized)

    https://www.google.com/recaptcha/api2/pat?k=[my_key]

    • This reply was modified 1 year, 4 months ago by sadhaka.
    Lucas Rodriguez

    (@lucasrodriguezest1994)

    I receive this issue as well when looking at my websites in Google Cloud that I’ve setup with Google ReCaptcha. It is not a problem exclusive to CF7 because I use my themes (Divi) native contact form modules and see the same error messages about assessments. I was browsing the internet and these forums in hopes of finding more information on this issue. When you follow the link for instructions it gives a few different options to create an assessment with code for each method.

    It seems to finish the backend setup a little more developer knowledge is required. There is php provided and I know WordPress is built on that I just need to know where to paste these functions. The most obvious choice would be to paste it into the functions.php file of my child theme but decided I should seek the communities expertise first.

    Integrate with your backend:

    1. To verify the token sent by reCAPTCHA and assess the risk, create assessments from your backend server.
    2. Interpret the assessment scores and the associated risk, and define how to handle users, for example, allow the user to log in only when the score is high and the risk is low.


      Create Assessment PHP

        <?php

      // Include Google Cloud dependencies using Composer
      // composer require google/cloud-recaptcha-enterprise
      require 'vendor/autoload.php';

      use Google\Cloud\RecaptchaEnterprise\V1\RecaptchaEnterpriseServiceClient;
      use Google\Cloud\RecaptchaEnterprise\V1\Event;
      use Google\Cloud\RecaptchaEnterprise\V1\Assessment;
      use Google\Cloud\RecaptchaEnterprise\V1\TokenProperties\InvalidReason;

      /**
      * Create an assessment to analyze the risk of a UI action.
      * @param string $siteKey The key ID for the reCAPTCHA key (See https://cloud.google.com/recaptcha/docs/create-key)
      * @param string $token The user's response token for which you want to receive a reCAPTCHA score. (See https://cloud.google.com/recaptcha/docs/create-assessment#retrieve_token)
      * @param string $project Your Google Cloud project ID
      */
      function create_assessment(
      string $siteKey,
      string $token,
      string $project
      ): void {
      // TODO: To avoid memory issues, move this client generation outside
      // of this example, and cache it (recommended) or call client.close()
      // before exiting this method.
      $client = new RecaptchaEnterpriseServiceClient();
      $projectName = $client->projectName($project);

      $event = (new Event())
      ->setSiteKey($siteKey)
      ->setToken($token);

      $assessment = (new Assessment())
      ->setEvent($event);

      try {
      $response = $client->createAssessment(
      $projectName,
      $assessment
      );

      // You can use the score only if the assessment is valid,
      // In case of failures like re-submitting the same token, getValid() will return false
      if ($response->getTokenProperties()->getValid() == false) {
      printf('The CreateAssessment() call failed because the token was invalid for the following reason: ');
      printf(InvalidReason::name($response->getTokenProperties()->getInvalidReason()));
      } else {
      printf('The score for the protection action is:');
      printf($response->getRiskAnalysis()->getScore());

      // Optional: You can use the following methods to get more data about the token
      // Action name provided at token generation.
      // printf($response->getTokenProperties()->getAction() . PHP_EOL);
      // The timestamp corresponding to the generation of the token.
      // printf($response->getTokenProperties()->getCreateTime()->getSeconds() . PHP_EOL);
      // The hostname of the page on which the token was generated.
      // printf($response->getTokenProperties()->getHostname() . PHP_EOL);
      }
      } catch (exception $e) {
      printf('CreateAssessment() call failed with the following error: ');
      printf($e);
      }
      }

      // TODO(Developer): Replace the following before running the sample
      create_assessment(
      'YOUR_RECAPTCHA_KEY',
      'YOUR_USER_RESPONSE_TOKEN',
      'YOUR_GOOGLE_CLOUD_PROJECT_ID'
      );
      ?>

      After your backend submits a user’s reCAPTCHA response token to reCAPTCHA, you receive an assessment as a JSON response as shown in the following example.

      To interpret an assessment, consider the following parameters:

      • valid: indicates whether the provided user response token is valid. When valid = false, the reason is specified in invalidReasonvalid = false can also indicate that a user has failed to solve a challenge or there is a siteKey mismatch.
      • invalidReason: Reason associated with the response when valid = false.
      • action: a user interaction that triggered reCAPTCHA verification.
      • expectedAction: the expected action from a user that you specified when creating the assessment.
      • score: level of risk the user interaction poses.
      • reasons: additional information about how reCAPTCHA has interpreted the user interaction.
      {
      "event":{
      "expectedAction":"EXPECTED_ACTION",
      "hashedAccountId":"ACCOUNT_ID",
      "siteKey":"KEY_ID",
      "token":"TOKEN",
      "userAgent":"(USER-PROVIDED STRING)",
      "userIpAddress":"USER_PROVIDED_IP_ADDRESS"
      },
      "name":"ASSESSMENT_ID",
      "riskAnalysis":{
      "reasons":[],
      "score":"SCORE"
      },
      "tokenProperties":{
      "action":"USER_INTERACTION",
      "createTime":"TIMESTAMP",
      "hostname":"HOSTNAME",
      "invalidReason":"(ENUM)",
      "valid":(BOOLEAN)
      }
      }

      I don’t really understand the JSON response part where you would find it or how to use it but hopefully someone in the community can shine some light on this topic.

      Thanks,

      Lucas Rodriguez

    Viewing 8 replies - 1 through 8 (of 8 total)

    The topic ‘Problem with google recaptcha v3 verification’ is closed to new replies.