パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.1.0

flutter_recaptcha_v2

Google ReCaptcha V2 用の Flutter プラグイン。

30日間ダウンロード
68
いいね数
39
Pub ポイント
15

パッケージをインストール

flutter pub add flutter_recaptcha_v2

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Flutterプラグインで、モバイルアプリケーションにGoogle ReCaptcha V2を統合し、開発者がフォームやログインフローにボット保護を追加できるようにします。AndroidおよびiOSプラットフォーム上でreCAPTCHAチャレンジをレンダリングおよび検証するためのシンプルなインターフェースを提供します。このプラグインは、GoogleのreCAPTCHAサービスとの下位レベルの通信を処理し、ユーザー操作の安全な検証を保証します。使いやすさを重視しており、非同期検証をサポートし、サーバーサイドでの検証用にトークンを返します。

用途

  • ログインフォームをボットから守る
  • 連絡フォームの送信を保護する
  • 自動アカウント作成の防止
  • 登録ワークフローにおけるセキュリティの強化
  • センシティブな操作におけるユーザー行動の検証

主な機能

  • Flutterアプリとのシンプルな統合
  • reCAPTCHA V2 の非表示および通常タイプをサポートしています
  • サーバー検証用の検証トークンを返します
  • クロスプラットフォーム互換性(AndroidおよびiOS)
  • 非同期検証ワークフロー

適している対象

  • セキュアな認証フローを構築する開発者
  • フォームでボット保護が必要なアプリ
  • 不正利用対策の遵守が必要なプロジェクト
  • FlutterにGoogleのreCAPTCHAサービスを統合するチーム
  • 自動的な悪用のリスクが高いモバイルアプリ

注意事項

  • reCAPTCHAの検証にはインターネット接続が必要です
  • サーバーサイドのトークン検証は必須です
  • 慎重に実装されない場合、ユーザー体験に影響を与える可能性があります
  • 外部のGoogleサービスの利用可能性に依存します
  • reCAPTCHA V2 に限定され、V3 以降のバージョンは対象外

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

flutter_recaptcha_v2

A Flutter plugin for Google ReCaptcha V2.

Getting Started

This plugin requires Webview to use Google ReCaptcha. This plugin only supports Google ReCAPTCHA V2 (not V3)

Obtain your own key & secret here: https://www.google.com/recaptcha

!!! Remember to add this domain into the reCaptcha setting or add your own domain: recaptcha-flutter-plugin.firebaseapp.com

Then test your API KEY at: https://recaptcha-flutter-plugin.firebaseapp.com/?api_key=API_KEY

Put RecaptchaV2 widget into your widget tree (Usually inside Stack widget), make sure it's placed on top of the tree and block all the behind interactions:

  • You can change the plugin url for the captcha domain insde the RecaptchaV2 or leave it by default non adding the line:
pluginURL: "https://mypersonalurl.com"

if you have setted your own domain, specify the domain used

  • To show the Cancel Button with the captcha controller set the boolean to true:
visibleCancelBottom: true

otherwise it won't appear

  • Set the Text for the Cancel buttom or leave it by default:
textCancelButtom: "CANCEL CAPTCHA"
Example
RecaptchaV2Controller recaptchaV2Controller = RecaptchaV2Controller();
...
RecaptchaV2(
    apiKey: "YOUR_API_KEY", // for enabling the reCaptcha
    apiSecret: "YOUR_API_SECRET", // for verifying the responded token
    pluginURL: "https://mypersonalurl.com",
	visibleCancelBottom: true,
	textCancelButtom: "CUSTOM CANCEL CAPTCHA BUTTOM TEXT",
	controller: recaptchaV2Controller,
    onVerifiedError: (err){
        print(err);
    },
    onVerifiedSuccessfully: (success) {
        setState(() {
            if (success) {
                // You've been verified successfully.
            } else {
                // "Failed to verify.
            }
        });
    },
),

The RecaptchaV2 widget is hidden by default, you need to attach the RecaptchaV2Controller and call show() method when needed. Like this:

recaptchaV2Controller.show();

Manually hide it:

recaptchaV2Controller.hide();

That's it!

カテゴリー

依存関係

依存関係一覧 2 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。