albert_wong
05/12/2025, 1:27 AMfeelheard://
### What I've Tried
1. Implemented a WebView-based reCAPTCHA solution that:
- Successfully generates a token (we see "reCAPTCHA verification successful" in logs)
- Passes the token to Medplum's startNewUser API
2. Added domain debugging which shows our WebView is loading from `about:blank`:
LOG WebView navigated to: about:blank
LOG WebView domain info: {"hostname": "", "href": "about:blank", "origin": "null"}
3. Added all known domains to our reCAPTCHA configuration:
### Current Issue
Despite getting a valid token from reCAPTCHA (we see successful
verification in logs), Medplum rejects it with:
LOG reCAPTCHA verification successful
LOG reCAPTCHA token received
LOG Starting patient registration with reCAPTCHA token...
ERROR Registration error: [Error: Recaptcha failed]
The core issue appears to be that our WebView is using about:blank as its origin, which:
1. Cannot be added to reCAPTCHA's domain configuration
2. Likely causes the token to be invalid when verified server-side
### Questions
1. How should we properly implement reCAPTCHA for Medplum registration in a mobile app context?
2. Does Medplum have a specific recommendation for handling reCAPTCHA in mobile apps?
3. Is there a way to bypass or modify reCAPTCHA requirements for mobile app registration?
4. Would you recommend redirecting to a web browser for registration instead?
Any guidance would be greatly appreciated! Thanks so much for your thoughts!reshma
05/12/2025, 3:19 PMalbert_wong
05/13/2025, 5:07 AM