{"id":17650741,"url":"https://github.com/eaceto/flutter_local_authentication","last_synced_at":"2025-08-22T01:18:11.170Z","repository":{"id":54148499,"uuid":"344925106","full_name":"eaceto/flutter_local_authentication","owner":"eaceto","description":"A flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android (Windows Hello is a work in progress).","archived":false,"fork":false,"pushed_at":"2024-02-14T10:44:44.000Z","size":411,"stargazers_count":4,"open_issues_count":4,"forks_count":10,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-05-07T07:07:12.362Z","etag":null,"topics":["android","biometric","biometric-authentication","biometric-identification","dart","fingerprint","flutter","ios","local-authentication","macos","password","plugin","security"],"latest_commit_sha":null,"homepage":"https://eaceto.dev","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eaceto.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2021-03-05T20:22:04.000Z","updated_at":"2024-08-12T06:14:54.000Z","dependencies_parsed_at":"2024-02-14T11:47:53.467Z","dependency_job_id":null,"html_url":"https://github.com/eaceto/flutter_local_authentication","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2Fflutter_local_authentication","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2Fflutter_local_authentication/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2Fflutter_local_authentication/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eaceto%2Fflutter_local_authentication/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eaceto","download_url":"https://codeload.github.com/eaceto/flutter_local_authentication/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252831256,"owners_count":21810783,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["android","biometric","biometric-authentication","biometric-identification","dart","fingerprint","flutter","ios","local-authentication","macos","password","plugin","security"],"created_at":"2024-10-23T11:39:21.653Z","updated_at":"2025-05-07T07:07:26.381Z","avatar_url":"https://github.com/eaceto.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Local Authentication\n\nA flutter plugin that allows access to Local Authentication / Biometrics on iOS, macOS, Linux and Android (Windows Hello is a work in progress).\n\n1. [Features](#features)\n2. [Changelog](CHANGELOG.md)\n3. [Usage](#usage)\n   3.1. [Initialization](#initialization)\n   3.2. [Localization](#localization)\n   3.3. [Querying support and performing Local Authentication](#querying-support-and-performing-local-authentication)\n4. [Considerations](#considerations)\n   4.1. [canAuthenticate](#canauthenticate)\n   4.2. [Supported Platforms](#supported-platforms)\n5. [Next Steps](#next-steps)\n6. [Contribution](CONTRIBUTING.md)\n7. [License](LICENSE)\n8. [Code of Conduct](CODE_OF_CONDUCT.md)\n\n---\n\n## Features\n\n- Detects if biometric authentication can be done in the current platform (**canAuthenticate**).\n\n- Triggers platform's native authentication for the current user (**authenticate**).\n\n- Read/Write macOS/iOS **touchIDAuthenticationAllowableReuseDuration** value\n\n- Localized messages for iOS, macOS and Android\n\n## Usage\n\n### Initialization\n\nInitialize an instance of the plugin, which requires no input parameters.\n\n```Dart\n  final _flutterLocalAuthenticationPlugin = FlutterLocalAuthentication();\n```\n\n### Localization\n\nAt any time a localization model can be applied. The latests applied is used by the plugin when the local authentication is performed.\n\n```Dart\n    final localization = LocalizationModel(\n        promptDialogTitle: \"title for dialog\",\n        promptDialogReason: \"reason for prompting biometric\",\n        cancelButtonTitle: \"cancel\"\n    );\n    _flutterLocalAuthenticationPlugin.setLocalizationModel(localization);\n```\n\n### Querying support and performing Local Authentication\n\nTwo functions are available for the core feature of this library:\n\n- canAuthenticate\n- authenticate\n\nDepending on each platform the behaviour of _canAuthenticate_ can differ.\n\n```Dart\n    bool canAuthenticate;\n    try {\n      // Query suppor for Local Authentication\n      canAuthenticate = await _flutterLocalAuthenticationPlugin.canAuthenticate();\n\n      // Setup TouchID Allowable Reuse duration\n      // It works only in iOS and macOS, but it's safe to call it even on other platforms.\n      await _flutterLocalAuthenticationPlugin.setTouchIDAuthenticationAllowableReuseDuration(30);\n    } on Exception catch (error) {\n      debugPrint(\"Exception checking support. $error\");\n      canAuthenticate = false;\n    }\n\n    if (canAuthenticate) {\n      // Perform Local Authentication\n\n      _flutterLocalAuthenticationPlugin.authenticate().then((authenticated) {\n        String result = 'Authenticated: $authenticated';\n        // handle result\n      }).catchError((error) {\n        String result = 'Exception: $error';\n        // handle error\n      });\n    }\n```\n\n## Considerations\n\n### canAuthenticate\n\nThe function _canAuthenticate_ will return **true** in the following scenarios.\n\n- Android: **true** if BiometricManager returns that it can authenticate with one of the following allowed authenticators:\n\n  - BiometricManager.Authenticators.BIOMETRIC_STRONG\n  - BiometricManager.Authenticators.BIOMETRIC_WEAK\n  - BiometricManager.Authenticators.DEVICE_CREDENTIAL\n\n- iOS: **true** if LAContext.supportsLocalAuthentication returns true for device policy:\n\n  - deviceOwnerAuthenticationWithBiometrics\n\n- macOS: **true** if LAContext.supportsLocalAuthentication returns true for device policy:\n\n  - deviceOwnerAuthentication\n\n- linux: **true** if _fprintd-verify_ is installed and user can execute it.\n\n### Supported platforms\n\n- iOS 12 or newer\n- macOS 10.12.2 or newer\n- Linux (requires libfprint)\n- Android 6.0 or newer\n\n## Next Steps\n\n- Add support to Windows Hello\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fflutter_local_authentication","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feaceto%2Fflutter_local_authentication","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feaceto%2Fflutter_local_authentication/lists"}