identity-idp
identity-idp copied to clipboard
LG-12873: Annotate reCAPTCHA assessments with MFA results
🎫 Ticket
🛠 Summary of changes
Updates phone setup flow to annotate a reCAPTCHA assessment after the user initiates and completes phone setup.
Related resources:
- https://cloud.google.com/recaptcha-enterprise/docs/annotate-assessment
📜 Testing Plan
Verify that you see events for annotating an assessment upon initiating and completing phone setup:
- Have
make runandmake watch_eventsrunning in parallel in two separate terminal processes - Visit http://localhost:3000
- Sign in or create an account
- When possible, add a phone to your account (clicking "Add phone number" at the account dashboard if signing in, or choosing "Text or voice message" at the MFA selection screen during account creation)
- Enter an international phone number, e.g.
+610491570006 - Click "Send code"
- Observe ~an event
recaptcha_assessment_annotated~ that theTelephony: OTP sentevent includes anrecaptcha_annotationwith non-nullassessment_idand areasonof'INITIATED_TWO_FACTOR' - Click "Submit" to submit the one-time code
- Observe ~an event
recaptcha_assessment_annotated~ that theMulti-factor authentication: Phone addedevent includes anrecaptcha_annotationwith non-nullassessment_id, areasonof'PASSED_TWO_FACTOR', and aannotationof'LEGITIMATE'
This is ready for review now. I've also tested this against real reCAPTCHA Enterprise which revealed some necessary changes in c0ef243, but worked successfully afterward. Let me know if you'd like to test the real Enterprise and I can get you set up with it.