Skip to content

LG-14711: Enable reCAPTCHA in log-only mode#11349

Merged
vrajmohan merged 1 commit intomainfrom
vm-enable-recaptcha-log-only-mode
Oct 21, 2024
Merged

LG-14711: Enable reCAPTCHA in log-only mode#11349
vrajmohan merged 1 commit intomainfrom
vm-enable-recaptcha-log-only-mode

Conversation

@vrajmohan
Copy link
Copy Markdown
Contributor

@vrajmohan vrajmohan commented Oct 15, 2024

changelog: Upcoming Features, reCAPTCHA, Enable reCAPTCHA in log-only mode

🎫 Ticket

Link to the relevant ticket:
LG-14711

🛠 Summary of changes

  1. Add a feature flag sign_in_recaptcha_log_failures_only that is by default false in all environments.
  2. When reCAPTCHA fails during sign-in, sign out the user and redirect them to an error page only if the flag sign_in_recaptcha_log_failures_only is set to true.

📜 Testing Plan

Set up an environment with the following config settings:

  1. recaptcha_mock_validator: true

  2. sign_in_recaptcha_log_failures_only: false

  3. sign_in_recaptcha_percent_tested: 100

  4. sign_in_recaptcha_score_threshold: 0.3

  5. Go to http://localhost:3000/ in an Incognito/Private Browsing window

  6. Sign in while setting reCAPTCHA to fail, e.g. a value of say 0.2

  7. Observe that you are shown a page with "Security check failed" as shown in the screenshot below

  8. Set sign_in_recaptcha_log_failures_only to true and restart the application

  9. Go to http://localhost:3000/ in an Incognito/Private Browsing window

  10. Sign in while setting reCAPTCHA to fail, e.g. a value of say 0.2

  11. Observe that you are not shown a page with "Security check failed". Instead you are taken to the next step of authentication.

  12. If you examine the events log, you should see an event named "Email and Password Authentication" with event_properties of {"success":true,"valid_captcha_result":false} - the authentication is successful even though the captcha test failed.

👀 Screenshots

If relevant, include a screenshot or screen capture of the changes.

Screenshot 2024-10-16 at 12 04 33 PM

@vrajmohan vrajmohan force-pushed the vm-enable-recaptcha-log-only-mode branch from 51e6709 to 63b616a Compare October 15, 2024 22:23
@vrajmohan vrajmohan requested a review from a team October 15, 2024 22:44
@aduth
Copy link
Copy Markdown
Contributor

aduth commented Oct 16, 2024

Can you add the pull request template content, particularly testing instructions?

@vrajmohan vrajmohan marked this pull request as draft October 16, 2024 19:45
@vrajmohan vrajmohan force-pushed the vm-enable-recaptcha-log-only-mode branch 3 times, most recently from 2528389 to dcfec2c Compare October 16, 2024 21:38
@vrajmohan vrajmohan marked this pull request as ready for review October 16, 2024 23:01
@vrajmohan vrajmohan requested a review from aduth October 16, 2024 23:01
Copy link
Copy Markdown
Contributor

@aduth aduth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested locally, LGTM 👍

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Was curious if we could bake the log-only consideration into valid_captcha_result?, but I see that it's valuable to include the raw result in the logging value below for valid_captcha_result. Nice separation 👍

@vrajmohan vrajmohan force-pushed the vm-enable-recaptcha-log-only-mode branch 2 times, most recently from 9acfad4 to a769f30 Compare October 17, 2024 19:13
@vrajmohan vrajmohan requested a review from aduth October 18, 2024 19:36
@vrajmohan vrajmohan force-pushed the vm-enable-recaptcha-log-only-mode branch 4 times, most recently from bb21bc5 to 7fc1ed7 Compare October 21, 2024 13:32
changelog: Upcoming Features, reCAPTCHA, Enable reCAPTCHA in log-only mode

Co-authored-by: Andrew Duthie <1779930+aduth@users.noreply.github.com>
@vrajmohan vrajmohan force-pushed the vm-enable-recaptcha-log-only-mode branch from 7fc1ed7 to 44e74de Compare October 21, 2024 14:17
@vrajmohan vrajmohan merged commit fc64d3c into main Oct 21, 2024
@vrajmohan vrajmohan deleted the vm-enable-recaptcha-log-only-mode branch October 21, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants