Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

FirebaseUI - using recaptcha with email sign-in method

I want to add a captcha functionality to my FirebaseUI email-based login to make it more difficult for bots and other abusers to log into my app.

I have investigated these:

  1. This link describes how to add a captcha to FirebaseUI when signing-in with a phone number but in my app I use the email signin method. I have tried doing the same for the email method:

    signInOptions: [
      {
         provider: authconst.EmailAuthProvider.PROVIDER_ID,
         recaptchaParameters: {
           type: 'image', // 'audio'
           size: 'normal', // 'invisible' or 'compact'
           badge: 'bottomleft' //' bottomright' or 'inline' applies to invisible.
         },
       },
    ],
    

But this wont trigger the recaptcha. How can I link the recaptcha to the email signing method?

  1. This link describes how to add recatcha to an app, but I need to link it to the sign-in method otherwise a bot could just bypass the catcha and trigger the sign-in making the captcha useless. How can I validate the captcha token response server-side? Are there some Cloud Function libraries to do that?
like image 846
l1b3rty Avatar asked Dec 06 '25 08:12

l1b3rty


1 Answers

Recaptcha verification is only available in the Phone provider for Firebase Authentication. There is no way to configure it for the email+password provider, and FirebaseUI is not set up to include a recaptcha in the email+password flow either.

If you want to require the users to sign in with email+password and require them to solve a recaptcha, you'll have to build that yourself.

like image 146
Frank van Puffelen Avatar answered Dec 07 '25 20:12

Frank van Puffelen



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!