Search code examples
flutterfirebaseauthenticationrecaptcha

How do I make my flutter app secure from spam attacks and malicious bots?


I have a flutter app where I perform user authentication with Firebase's email and password authentication. I want to secure the app from spam/bot attacks so that it doesn't cost me a fortune to host my users on Firebase. I have the sign up with email and password, login, and forgot password that I want to secure with something like reCaptcha. The app will be available on ios, android, macos, and potentially web. What is the easiest and the most secure way of implementing this?

So far, I have tried looking into flutter docs for plugins but the ones I found were all only for web apps. I also tried implementing reCaptcha V3 through Firebase's App Check feature and it sends requests to my reCaptcha API but does not seem to be working in release mode. Moreover, the App Check for android only supports Play Integrity which is a paid version and I would prefer a free service. I haven't yet looked into SafetyNet.


Solution

  • For Web/MacOs : As you stated that their is an library for that , you can use that to secure your webpage. In addition also do the following stated In Android/ios.

    For Android/Ios : these platform does not work like WebPage so One can not run script on these platforms . if you want to protect your app from automation (bot clicker etc.) you can setup/implement your own captcha / script/ mathematic algorithm ,

    example:

       1. setting up algorithm for users to solve some problem like - 12 + 5 = ? 
    

    You can setup image instead of text numbers.

       2. setup direction captcha , I see this one on github login . It's easy to setup .
    

    github loging captcha

    There are many other algorithm that you can implement.