Patient Self-Registraiton in React Native/Expo Mob...
# support
a
Hi Everyone! Hope you're all well! I'm working on implementing patient self-registration in our React Native/Expo mobile app and facing challenges. Would appreciate some guidance. 🙂 @User @User ### Current Setup - Using Medplum for authentication and patient data - React Native/Expo mobile app for Android/iOS - reCAPTCHA v3 with site key - Medplum Client Application configured with redirect URI
feelheard://
### 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!
r
Yes, I do think that web browser, or somewhere with a proper origin is a best practice for reCAPTCHA (for security reasons). We do not have specific recommendations for handling reCAPTCHA in mobile apps!
a
Thanks as always, @reshma for your thoughtful response and great advice! 🙂
155 Views