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

パッケージ詳細v0.0.2

biometricx

Flutter アプリでバイオメトリック認証を使用する簡単な方法。

Android
30日間ダウンロード
145
いいね数
36
Pub ポイント
150

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

flutter pub add biometricx

パッケージ概要

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

BiometricX は、Android アプリに指紋や顔認識などのバイオメトリック認証を統合するのを簡単にする Flutter パッケージです。バイオメトリック機能の利用可能性を確認し、デバイスレベルのバイオメトリクスを使用してユーザーを安全に認証するためのシンプルな API を提供します。使いやすさを重視しており、複雑なプラットフォーム固有の実装を抽象化し、最小限のコードでセキュアな認証を実装できるようにしています。このパッケージは Android のみをサポートし、信頼性の高いパフォーマンスとセキュリティのためにネイティブのバイオメトリック API を活用しています。

用途

  • セキュアなアプリログイン
  • ユーザーIDの検証
  • 保護されたデータアクセス
  • セッションの再認証
  • 二要素認証

主な機能

  • 生体認証チェックのためのシンプルな API
  • Android専用のサポート
  • セキュアなバイオメトリック認証
  • 自動フォールバック処理
  • 最小限のセットアップが必要

適している対象

  • セキュアなユーザー認証を必要とするアプリ
  • 迅速なバイオメトリック統合を求める開発者
  • Androidセキュリティに焦点を当てたプロジェクト
  • 機密データを含むモバイルアプリ
  • 迅速なバイオメトリックテストが必要なプロトタイプ

注意事項

  • Android プラットフォームに限定
  • デバイスの生体認証ハードウェアが必要です
  • iOS 対応なし
  • Android SDK バージョンの互換性に依存します
  • マニフェストでの適切な権限処理が必要です

元の README

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

BiometricX

The easy way to use biometric authentication in your Flutter app.
Supports Fingerprint, FaceID and Iris.

Demo APK.

Starting

$ flutter pub add biometricx

Configuration

Change your android MainActivity to extends FlutterFragmentActivity.

import io.flutter.embedding.android.FlutterFragmentActivity

// kotlin
class MainActivity: FlutterFragmentActivity() {
  ...
}
import io.flutter.embedding.android.FlutterFragmentActivity;

// java
class MainActivity extends FlutterFragmentActivity {
  ...
}

Usage

To check biometric type of your device.

BiometricType type = await BiometricX.type;

Here is the list of biometric types.

BiometricType.FACE
BiometricType.FINGERPRINT
BiometricType.IRIS
BiometricType.MULTIPLE
BiometricType.NONE
BiometricType.NO_HARDWARE
BiometricType.UNAVAILABLE
BiometricType.UNSUPPORTED

To check if your device can use biometric authentication.

bool isBiometricEnabled = await BiometricX.isEnabled;

To encrypt data using biometric authentication.

BiometricResult result = await BiometricX.encrypt({
  biometricKey: 'salkuadrat',
  message: 'This is a very secret message',
});

if (result.isSuccess && result.hasData) {
  // Keep this messageKey to decrypt your message.
  // This messageKey will be randomly generated by BiometricX plugin.
  String messageKey = result.data!;
} else {
  showToast(result.errorMsg, context: context);
}

If you need a persistent messageKey, you can supply it as parameter to encrypt.

BiometricResult result = await BiometricX.encrypt({
  biometricKey: 'salkuadrat',
  messageKey: 'secret_message', // use persistent messageKey
  message: 'This is a very secret message',
});

if (result.isSuccess && result.hasData) {
  // Keep this messageKey to decrypt your message.
  // This will be the same value as messageKey above ('secret_message')
  String messageKey = result.data!;
} else {
  showToast(result.errorMsg, context: context);
}

To decrypt data using biometric authentication.

// Use the same biometricKey that is used to encrypt your message.
// Use messageKey that you get from [BiometricX.encrypt].
BiometricResult result = await BiometricX.decrypt({
  biometricKey: 'salkuadrat',
  messageKey: messageKey,
});

if (result.isSuccess && result.hasData) {
  // This will contains your original message.
  String message = result.data!;
} else {
  showToast(result.errorMsg, context: context);
}

To show custom message in your biometric prompt, method encrypt and decrypt have parameters you can use to change the biometric prompt dialog.

BiometricResult result = await BiometricX.encrypt({
  biometricKey: 'salkuadrat',
  message: 'This is a very secret message',
  title: 'Biometric Encryption',
  subtitle: 'Enter biometric credentials to encrypt your message',
  description: 'Scan fingerprint or face.',
  negativeButtonText: 'USE PASSWORD',
  confirmationRequired: true,
});
BiometricResult message = await BiometricX.decrypt({
  biometricKey: 'salkuadrat',
  messageKey: messageKey,
  title: 'Biometric Decryption',
  subtitle: 'Enter biometric credentials to decrypt your message',
  description: 'Scan fingerprint or face.',
  negativeButtonText: 'USE PASSWORD',
  confirmationRequired: true,
});

Example

Example project.
Demo APK.

カテゴリー

ソースリポジトリ

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

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