Coder Social home page Coder Social logo

zujaj / recaptcha_v3_tutorial Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 2.0 98 KB

Demonstrates the implementation of Google reCAPTCHA v3 in Flutter Web.

Kotlin 0.86% Swift 2.52% Objective-C 0.24% Dart 71.07% HTML 25.31%
google-recaptcha-v3 flutter flutterweb flutter-apps flutter-security

recaptcha_v3_tutorial's Introduction

recaptcha_v3_tutorial

Depiction of Bot Attack on a Web Form. As a web developer, do you want to:

๐Ÿ›ก๏ธ Secure the website traffic from spam data?

๐Ÿงน Detect bots injecting malicious code in web forms?

๐Ÿ“ˆ Integrate a ready-made solution for risk analysis?

This project is a demo tutorial through which you can learn the implementation of Google reCAPTCHA v3 in Flutter Web.

Project Structure

recaptcha_v3_tutorial
โ”œโ”€ lib
โ”‚  โ”œโ”€ config 
โ”‚  โ”‚  โ””โ”€ config.dart // Holds the confidential information.
โ”‚  โ”œโ”€ model
โ”‚  โ”‚  โ””โ”€ recaptcha_response.dart // Holds the Google reCAPTCHA v3 HTTP Response.
โ”‚  โ”œโ”€ page
โ”‚  โ”‚  โ””โ”€ demo_page.dart // A Demo Page with a [FlutterLogo],a [NameField] & an [ElevatedButton].
โ”‚  โ”œโ”€ service
โ”‚  โ”‚  โ””โ”€ recaptcha_service.dart // Holds the Google reCAPTCHA v3 Operations.
โ”‚  โ”œโ”€ widget
โ”‚  โ”‚   โ”œโ”€ info_dialog.dart // Shows an [AlertDialog] to the user.  
โ”‚  โ”‚   โ””โ”€ name_field.dart // Shows a custom [TextFormField] to the user.  
โ”‚  โ”œโ”€ main.dart
โ”œโ”€  web
โ”‚  โ”œโ”€ index.html
โ”œโ”€ pubspec.lock
โ”œโ”€ pubspec.yaml
โ”œโ”€ README.md

Getting Started

  1. Register your site via the Google reCAPTCHA.

    Illustration of Google reCAPTCHA v3 Site Registration Form

  2. Copy the reCAPTCHA v3 site and secret keys.

    Illustration of Google reCAPTCHA v3 Site and Secret Keys.

  3. Navigate to the web folder, open the index.html file and paste the below script inside the <body> tag.

    <body>
     <script src="https://www.google.com/recaptcha/api.js?render=recaptcha-site-key"></script>
     <!-- This script installs service_worker.js to provide PWA functionality to
       application. For more information, see:
       https://developers.google.com/web/fundamentals/primers/service-workers -->
    </body>
  4. In the config.dart file, paste the reCAPTCHA site & secret key.

    /// Holds the 'Site Key' for the `Google reCAPTCHA v3` API.
    static const String siteKey = 'recaptcha-site-key';
    
    /// Holds the 'Secret Key' for the `Google reCAPTCHA v3` API.
    static const String secretKey = 'recaptcha-secret-key';
  5. Congratulations! You're done, run the app.

    Demo of the Google reCAPTCHA v3 in Flutter Web

TOOLS & LANGUAGE

recaptcha_v3_tutorial's People

Contributors

zujaj avatar

Stargazers

 avatar  avatar

Watchers

 avatar

recaptcha_v3_tutorial's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.