패키지, 저장소 및 앱 카테고리 검색

패키지 상세v2.2.0

flutter_locker

지문, 터치 ID, 얼굴 인식 등 생체 인증을 사용하여 키체인에서 비밀을 보호합니다

AndroidiOS
30일 다운로드
4천
좋아요
50
Pub 점수
160

패키지 설치

flutter pub add flutter_locker

패키지 개요

공개 정보를 바탕으로 생성한 선택 가이드입니다.

Flutter Locker는 생체 인식 인증(지문, Touch ID, Face ID)을 사용하여 플랫폼별 키체인을 활용해 민감한 데이터를 안전하게 저장하고 검색하는 패키지입니다. 안드로이드와 iOS의 네이티브 보안 기능을 활용하여 API 키나 토큰과 같은 비밀 정보를 보호합니다. 이 패키지는 데이터가 암호화된 상태로 유지되며, 성공적인 생체 인식 인증 후에만 접근 가능하도록 보장함으로써 사용자 경험을 해치지 않으면서 앱 보안을 강화합니다. 고보안 로컬 스토리지가 필요한 앱에 적합합니다.

사용 사례

  • API 키를 안전하게 저장하세요
  • 사용자 자격 증명 보호
  • 민감한 데이터에 생체 인식 접근 권한 활성화
  • 암호화 키를 로컬에 저장합니다
  • 안전한 세션 관리 구현

주요 기능

  • 생체 인증 통합
  • 플랫폼 네이티브 키체인 사용
  • 암호화된 로컬 저장소
  • 안전한 액세스를 위한 간단한 API
  • 생체 인식이 실패하면 암호로 자동 전환

적합한 대상

  • 민감한 사용자 데이터를 처리하는 앱
  • 금융 또는 헬스케어 애플리케이션
  • 인증 중심 앱
  • 안전한 로컬 저장소가 필요한 앱
  • 사용자 프라이버시를 우선시하는 개발자

고려 사항

  • 생체 인식 하드웨어 지원 필요
  • Android 및 iOS 플랫폼에 제한됨
  • 추가 권한 처리가 필요할 수 있습니다
  • 비생체 환경에는 적합하지 않습니다
  • 기반 운영 체제 보안 메커니즘에 따라 다름

원본 README

연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.

Flutter Locker🔒

Locker

Flutter plugin that secures your secrets in keychain using biometric authentication (Fingerprint, Touch ID, Face ID...).

It uses:

Table of contents

Migrate to 2.1.0

The models now accept named parameters instead of unnamed, e.g.:

RetrieveSecretRequest(
  key: 'key',
  androidPrompt: AndroidPrompt(title: 'title', cancelLabel: 'cancel'),
  iOsPrompt: IOsPrompt(touchIdText: 'description'),
)

Usage

FlutterLocker.supportsBiometricAuthentication();

Checks if the devices has biometric capabilities no matter if they are configured and turned on.

FlutterLocker.canAuthenticate();

Checks if the devices has biometric capabilities that are configured and turned on.

await FlutterLocker.save(SaveSecretRequest(
  key: 'key',
  secret: 'secret',
  androidPrompt: AndroidPrompt(title: 'Authenticate', cancelLabel: 'Cancel'),
));

Saves the secret. On Android prompt is shown, while on iOS there is no need for the prompt when saving.

await FlutterLocker.retrieve(RetrieveSecretRequest(
  key: key,
  androidPrompt: AndroidPrompt(title: 'Authenticate', cancelLabel: 'Cancel'),
  iOsPrompt: IOsPrompt(touchIdText: 'Authenticate'),
));

Retrieves the secret. You need to provide a prompt for Android and iOS. Prompt for iOS is used only with TouchID. FaceID uses strings from Info.plist.

await FlutterLocker.delete('key');

Deletes the secret.

Exceptions

For common exceptions, a LockerException is thrown.

Use LockerException.reason to find out what went wrong:

  • secretNotFound - Happens when you try to retrieve a secret that was never saved for that key
  • authenticationCanceled - User canceled the authentication prompt
  • authenticationFailed - User failed authentication, e.g. by too many wrong attempts

For other exception, a PlatformException is thrown. You can use PlatformException.message to get more info.

Notes

  • iOS only: app will not show authentication dialog when saving (authentication will always succeed)
  • please follow Locker and Goldfinger setup to prevent any issues

Setup

iOS

To use Locker you need to add the NSFaceIDUsageDescription to you Info.plist.

If NSFaceIDUsageDescription is not provided, the app will crash with the following error:

This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSFaceIDUsageDescription key with a string value explaining to the user how the app uses this data.
Android

Ensure MainActivity extends FlutterFragmentActivity.

class MainActivity: FlutterFragmentActivity() {
    // ...
}

When showing authentication prompt, the app might crash on some Samsung devices if you don't use an appropriate theme: https://github.com/infinum/flutter-plugins-locker/commit/fcb1f6401d89f860d24ea9a75027d62a03e87926.

Contributing

We believe that the community can help us improve and build better a product. Please refer to our contributing guide to learn about the types of contributions we accept and the process for submitting them.

To ensure that our community remains respectful and professional, we defined a code of conduct that we expect all contributors to follow.

We appreciate your interest and look forward to your contributions.

License

Copyright 2024 Infinum

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

    http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

Credits

Maintained and sponsored by Infinum.

카테고리

소스 저장소

이 패키지를 사용하는 프로젝트