1

Firebase Phone Authentication in Angular and Cordova Android app with External Recaptcha Token.

I am creating an application which requires Phone authentication through Firebase. The application is web-based in Angular, and wrapped in Cordova for Android and iOS. When running on the web-browser, all is working great. When wrapping in Cordova and running in a browser, all is still great. But when building the Android APK and running on Android, the Phone Authentication doesn't work properly, because the ReCaptcha renderer fails to load since the origin is "file:\\" on Android.

I searched a lot on the web, and it seems this is the only viable solution

In this answer, I was able to follow steps 1, 2 and 3 to host the ReCaptcha on a website that the app redirects to, perform the ReCaptcha verification there and retrieve a ReCaptcha Token.

However in Step 4, it says the following:

Parse the reCAPTCHA token from the deep link. Repackage it in a firebase.auth.ApplicationVerifier implementation.

Is anyone able to help on how to Repackage a reCAPTCHA token in a firebase.auth.ApplicationVerifier ?

I couldn't find a way to do it until now, any help is much appreciated!

1 Answers1

0

Afterall I was able to achieve Firebase Authentication with Cordova on Android with no need to apply the complex workaroud mentioned.

I followed the steps in this video using cordova firebase plugin and it worked well, and did not require a ReCaptcha verification.