CINXE.COM
local_auth | Flutter package
<!DOCTYPE html> <html lang="en-us"><head><script src="https://www.googletagmanager.com/gtm.js?id=GTM-MX6DBN9" async="async"></script><script src="/static/hash-j60jq2j3/js/gtm.js" async="async"></script><meta charset="utf-8"/><meta http-equiv="x-ua-compatible" content="ie=edge"/><meta name="viewport" content="width=device-width, initial-scale=1"/><meta name="twitter:card" content="summary"/><meta name="twitter:site" content="@dart_lang"/><meta name="twitter:description" content="Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern."/><meta name="twitter:image" content="https://pub.dev/static/hash-j60jq2j3/img/pub-dev-icon-cover-image.png"/><meta property="og:type" content="website"/><meta property="og:site_name" content="Dart packages"/><meta property="og:title" content="local_auth | Flutter package"/><meta property="og:description" content="Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern."/><meta property="og:image" content="https://pub.dev/static/hash-j60jq2j3/img/pub-dev-icon-cover-image.png"/><meta property="og:url" content="https://pub.dev/packages/local_auth"/><title>local_auth | Flutter package</title><link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Google+Sans:wght@400;500;700&family=Google+Sans+Display:wght@400&family=Google+Sans+Text:wght@400;500;700&family=Google+Sans+Mono:wght@400;700&display=swap"/><link rel="shortcut icon" href="/static/hash-j60jq2j3/img/flutter-logo-32x32.png"/><meta rel="apple-touch-icon" href="/static/hash-j60jq2j3/img/flutter-logo-32x32.png"/><meta rel="apple-touch-icon-precomposed" href="/static/hash-j60jq2j3/img/flutter-logo-32x32.png"/><link rel="stylesheet" href="https://www.gstatic.com/glue/v25_0/ccb.min.css"/><link rel="search" type="application/opensearchdescription+xml" title="Dart packages" href="/osd.xml"/><link rel="canonical" href="https://pub.dev/packages/local_auth"/><meta name="description" content="Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern."/><link rel="alternate" type="application/atom+xml" title="Updated Packages Feed for Pub" href="/feed.atom"/><link rel="stylesheet" type="text/css" href="/static/hash-j60jq2j3/material/bundle/styles.css"/><link rel="stylesheet" type="text/css" href="/static/hash-j60jq2j3/css/style.css"/><script src="/static/hash-j60jq2j3/material/bundle/script.min.js" defer="defer"></script><script src="/static/hash-j60jq2j3/js/script.dart.js" defer="defer"></script><script src="https://www.gstatic.com/brandstudio/kato/cookie_choice_component/cookie_consent_bar.v3.js" defer="defer" data-autoload-cookie-consent-bar="true"></script><meta name="pub-page-data" content="eyJwa2dEYXRhIjp7InBhY2thZ2UiOiJsb2NhbF9hdXRoIiwidmVyc2lvbiI6IjIuMy4wIiwibGlrZXMiOjMxMTYsInB1Ymxpc2hlcklkIjoiZmx1dHRlci5kZXYiLCJpc0Rpc2NvbnRpbnVlZCI6ZmFsc2UsImlzTGF0ZXN0Ijp0cnVlfSwic2Vzc2lvbkF3YXJlIjpmYWxzZX0="/><link rel="preload" href="/static/hash-j60jq2j3/highlight/highlight-with-init.js" as="script"/></head><body class="light-theme"><script src="/static/hash-j60jq2j3/js/dark-init.js"></script><noscript><iframe src="https://www.googletagmanager.com/ns.html?id=GTM-MX6DBN9" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript><div class="site-header"><button class="hamburger" aria-label="menu toggle"></button><a class="logo" href="/" aria-label="Go to the landing page of pub.dev"><img class="site-logo" src="/static/hash-j60jq2j3/img/pub-dev-logo.svg" alt="" width="140" height="30" role="presentation"/></a><div class="site-header-space"></div><div class="site-header-mask"></div><div class="site-header-search"><form action="/packages" method="GET"><input class="site-header-search-input" name="q" placeholder="New search..." autocomplete="on" title="Search"/></form></div><nav class="site-header-nav scroll-container"><div class="nav-login-container"><button id="-account-login" class="nav-main-button link">Sign in</button></div><div class="nav-container nav-help-container hoverable"><button class="nav-main-button">Help</button><div class="nav-hover-popup"><div class="nav-table-columns"><div class="nav-table-column"><h3>pub.dev</h3><a class="nav-link" href="/help/search" rel="noopener" target="_blank">Searching for packages</a><a class="nav-link" href="/help/scoring" rel="noopener" target="_blank">Package scoring and pub points</a></div><div class="nav-table-column"><h3>Flutter</h3><a class="nav-link" href="https://flutter.dev/using-packages/" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://flutter.dev/developing-packages/" rel="noopener" target="_blank">Developing packages and plugins</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div><div class="nav-table-column"><h3>Dart</h3><a class="nav-link" href="https://dart.dev/guides/packages" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">pub.dev <img class="foldable-icon" src="/static/hash-j60jq2j3/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="/help/search" rel="noopener" target="_blank">Searching for packages</a><a class="nav-link" href="/help/scoring" rel="noopener" target="_blank">Package scoring and pub points</a></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">Flutter <img class="foldable-icon" src="/static/hash-j60jq2j3/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="https://flutter.dev/using-packages/" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://flutter.dev/developing-packages/" rel="noopener" target="_blank">Developing packages and plugins</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div><div class="nav-container nav-help-container-mobile foldable"><h3 class="foldable-button">Dart <img class="foldable-icon" src="/static/hash-j60jq2j3/img/nav-mobile-foldable-icon.svg" alt="toggle folding of the section" width="13" height="6"/></h3><div class="foldable-content"><a class="nav-link" href="https://dart.dev/guides/packages" rel="noopener" target="_blank">Using packages</a><a class="nav-link" href="https://dart.dev/tools/pub/publishing" rel="noopener" target="_blank">Publishing a package</a></div></div></nav><button class="-pub-theme-toggle" aria-label="light/dark theme toggle"></button></div><div id="banner-container"></div><main class="container"><div class="detail-wrapper -active -has-info-box"><div class="detail-header -is-loose"><div class="detail-container"><div class="detail-header-outer-block"><div class="detail-header-content-block"><h1 class="title pub-monochrome-icon-hoverable">local_auth 2.3.0 <span class="pkg-page-title-copy"><img class="pub-monochrome-icon pkg-page-title-copy-icon filter-invert-on-dark" src="/static/hash-j60jq2j3/img/content-copy-icon.svg" alt="copy "local_auth: ^2.3.0" to clipboard" width="18" height="18" title="Copy "local_auth: ^2.3.0" to clipboard" data-copy-content="local_auth: ^2.3.0" data-ga-click-event="copy-package-version"/><div class="pkg-page-title-copy-feedback"><span class="code">local_auth: ^2.3.0</span> copied to clipboard</div></span></h1><div class="metadata">Published <span><a class="-x-ago" href="" title="Aug 6, 2024" role="button" data-timestamp="1722958020675">8 months ago</a></span> • <a class="-pub-publisher" href="/publishers/flutter.dev"><img class="-pub-publisher-shield filter-invert-on-dark" src="/static/hash-j60jq2j3/img/material-icon-verified.svg" alt="verified publisher" width="14" height="14" title="Published by a pub.dev verified publisher"/>flutter.dev</a><span class="package-badge" title="Package is compatible with Dart 3.">Dart 3 compatible</span></div><div class="detail-tags-and-like"><div class="detail-tags"><div class="-pub-tag-badge"><span class="tag-badge-main">SDK</span><a class="tag-badge-sub" href="/packages?q=sdk%3Aflutter" rel="nofollow" title="Packages compatible with Flutter SDK">Flutter</a></div><div class="-pub-tag-badge"><span class="tag-badge-main">Platform</span><a class="tag-badge-sub" href="/packages?q=platform%3Aandroid" rel="nofollow" title="Packages compatible with Android platform">Android</a><a class="tag-badge-sub" href="/packages?q=platform%3Aios" rel="nofollow" title="Packages compatible with iOS platform">iOS</a><a class="tag-badge-sub" href="/packages?q=platform%3Amacos" rel="nofollow" title="Packages compatible with macOS platform">macOS</a><a class="tag-badge-sub" href="/packages?q=platform%3Awindows" rel="nofollow" title="Packages compatible with Windows platform">Windows</a></div></div><div class="detail-like"><button id="-pub-like-icon-button" class="mdc-icon-button" data-ga-click-event="toggle-like" aria-pressed="false" title="Like this package"><img class="mdc-icon-button__icon" src="/static/hash-j60jq2j3/img/like-inactive.svg" alt="liked status: inactive" width="18" height="18"/><img class="mdc-icon-button__icon mdc-icon-button__icon--on" src="/static/hash-j60jq2j3/img/like-active.svg" alt="liked status: active" width="18" height="18"/></button><span class="likes-count"><span id="likes-count">3.1k</span></span></div></div></div></div></div></div><div class="detail-container"><div class="detail-lead"><div class="detail-metadata-toggle"><div class="detail-metadata-toggle-icon">→</div><h3 class="detail-lead-title">Metadata</h3></div><p class="detail-lead-text">Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.</p><p class="detail-lead-more"><a class="detail-metadata-toggle">More...</a></p></div></div><div class="detail-body"><div class="detail-tabs"><div class="detail-tabs-wide-header"><div class="detail-container"><ul class="detail-tabs-header"><li class="detail-tab tab-button detail-tab-readme-title -active">Readme</li><li class="detail-tab tab-link detail-tab-changelog-title"><a href="/packages/local_auth/changelog" role="button">Changelog</a></li><li class="detail-tab tab-link detail-tab-example-title"><a href="/packages/local_auth/example" role="button">Example</a></li><li class="detail-tab tab-link detail-tab-installing-title"><a href="/packages/local_auth/install" role="button">Installing</a></li><li class="detail-tab tab-link detail-tab-versions-title"><a href="/packages/local_auth/versions" role="button">Versions</a></li><li class="detail-tab tab-link detail-tab-analysis-title"><a href="/packages/local_auth/score" role="button">Scores</a></li></ul></div></div><div class="detail-container detail-body-main"><div class="detail-tabs-content"><section class="tab-content detail-tab-readme-content -active markdown-body"><h1 id="local_auth" class="hash-header">local_auth <a href="#local_auth" class="hash-link">#</a></h1> <!--?code-excerpt path-base="example/lib"?--> <p>This Flutter plugin provides means to perform local, on-device authentication of the user.</p> <p>On supported devices, this includes authentication with biometrics such as fingerprint or facial recognition.</p> <table> <thead> <tr> <th></th> <th>Android</th> <th>iOS</th> <th>macOS</th> <th>Windows</th> </tr> </thead> <tbody> <tr> <td><strong>Support</strong></td> <td>SDK 16+*</td> <td>12.0+</td> <td>10.14+</td> <td>Windows 10+</td> </tr> </tbody> </table> <h2 id="usage" class="hash-header">Usage <a href="#usage" class="hash-link">#</a></h2> <h3 id="device-capabilities" class="hash-header">Device Capabilities <a href="#device-capabilities" class="hash-link">#</a></h3> <p>To check whether there is local authentication available on this device or not, call <code>canCheckBiometrics</code> (if you need biometrics support) and/or <code>isDeviceSupported()</code> (if you just need some device-level authentication):</p> <!--?code-excerpt "readme_excerpts.dart (CanCheck)"?--> <pre><code class="language-dart">import 'package:local_auth/local_auth.dart'; // ··· final LocalAuthentication auth = LocalAuthentication(); // ··· final bool canAuthenticateWithBiometrics = await auth.canCheckBiometrics; final bool canAuthenticate = canAuthenticateWithBiometrics || await auth.isDeviceSupported(); </code></pre> <p>Currently the following biometric types are implemented:</p> <ul> <li>BiometricType.face</li> <li>BiometricType.fingerprint</li> <li>BiometricType.weak</li> <li>BiometricType.strong</li> </ul> <h3 id="enrolled-biometrics" class="hash-header">Enrolled Biometrics <a href="#enrolled-biometrics" class="hash-link">#</a></h3> <p><code>canCheckBiometrics</code> only indicates whether hardware support is available, not whether the device has any biometrics enrolled. To get a list of enrolled biometrics, call <code>getAvailableBiometrics()</code>.</p> <p>The types are device-specific and platform-specific, and other types may be added in the future, so when possible you should not rely on specific biometric types and only check that some biometric is enrolled:</p> <!--?code-excerpt "readme_excerpts.dart (Enrolled)"?--> <pre><code class="language-dart">final List<BiometricType> availableBiometrics = await auth.getAvailableBiometrics(); if (availableBiometrics.isNotEmpty) { // Some biometrics are enrolled. } if (availableBiometrics.contains(BiometricType.strong) || availableBiometrics.contains(BiometricType.face)) { // Specific types of biometrics are available. // Use checks like this with caution! } </code></pre> <h3 id="options" class="hash-header">Options <a href="#options" class="hash-link">#</a></h3> <p>The <code>authenticate()</code> method uses biometric authentication when possible, but also allows fallback to pin, pattern, or passcode.</p> <!--?code-excerpt "readme_excerpts.dart (AuthAny)"?--> <pre><code class="language-dart">try { final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance'); // ··· } on PlatformException { // ... } </code></pre> <p>To require biometric authentication, pass <code>AuthenticationOptions</code> with <code>biometricOnly</code> set to <code>true</code>.</p> <!--?code-excerpt "readme_excerpts.dart (AuthBioOnly)"?--> <pre><code class="language-dart">final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance', options: const AuthenticationOptions(biometricOnly: true)); </code></pre> <p><em>Note</em>: <code>biometricOnly</code> is not supported on Windows since the Windows implementation's underlying API (Windows Hello) doesn't support selecting the authentication method.</p> <h4 id="dialogs">Dialogs</h4> <p>The plugin provides default dialogs for the following cases:</p> <ol> <li>Passcode/PIN/Pattern Not Set: The user has not yet configured a passcode on iOS or PIN/pattern on Android.</li> <li>Biometrics Not Enrolled: The user has not enrolled any biometrics on the device.</li> </ol> <p>If a user does not have the necessary authentication enrolled when <code>authenticate</code> is called, they will be given the option to enroll at that point, or cancel authentication.</p> <p>If you don't want to use the default dialogs, set the <code>useErrorDialogs</code> option to <code>false</code> to have <code>authenticate</code> immediately return an error in those cases.</p> <!--?code-excerpt "readme_excerpts.dart (NoErrorDialogs)"?--> <pre><code class="language-dart">import 'package:local_auth/error_codes.dart' as auth_error; // ··· try { final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance', options: const AuthenticationOptions(useErrorDialogs: false)); // ··· } on PlatformException catch (e) { if (e.code == auth_error.notAvailable) { // Add handling of no hardware here. } else if (e.code == auth_error.notEnrolled) { // ... } else { // ... } } </code></pre> <p>If you want to customize the messages in the dialogs, you can pass <code>AuthMessages</code> for each platform you support. These are platform-specific, so you will need to import the platform-specific implementation packages. For instance, to customize Android and iOS:</p> <!--?code-excerpt "readme_excerpts.dart (CustomMessages)"?--> <pre><code class="language-dart">import 'package:local_auth_android/local_auth_android.dart'; import 'package:local_auth_darwin/local_auth_darwin.dart'; // ··· final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance', authMessages: const <AuthMessages>[ AndroidAuthMessages( signInTitle: 'Oops! Biometric authentication required!', cancelButton: 'No thanks', ), IOSAuthMessages( cancelButton: 'No thanks', ), ]); </code></pre> <p>See the platform-specific classes for details about what can be customized on each platform.</p> <h3 id="exceptions" class="hash-header">Exceptions <a href="#exceptions" class="hash-link">#</a></h3> <p><code>authenticate</code> throws <code>PlatformException</code>s in many error cases. See <code>error_codes.dart</code> for known error codes that you may want to have specific handling for. For example:</p> <!--?code-excerpt "readme_excerpts.dart (ErrorHandling)"?--> <pre><code class="language-dart">import 'package:flutter/services.dart'; import 'package:local_auth/error_codes.dart' as auth_error; import 'package:local_auth/local_auth.dart'; // ··· final LocalAuthentication auth = LocalAuthentication(); // ··· try { final bool didAuthenticate = await auth.authenticate( localizedReason: 'Please authenticate to show account balance', options: const AuthenticationOptions(useErrorDialogs: false)); // ··· } on PlatformException catch (e) { if (e.code == auth_error.notEnrolled) { // Add handling of no hardware here. } else if (e.code == auth_error.lockedOut || e.code == auth_error.permanentlyLockedOut) { // ... } else { // ... } } </code></pre> <h2 id="ios-integration" class="hash-header">iOS Integration <a href="#ios-integration" class="hash-link">#</a></h2> <p>Note that this plugin works with both Touch ID and Face ID. However, to use the latter, you need to also add:</p> <pre><code class="language-xml"><key>NSFaceIDUsageDescription</key> <string>Why is my app authenticating using face id?</string> </code></pre> <p>to your Info.plist file. Failure to do so results in a dialog that tells the user your app has not been updated to use Face ID.</p> <h2 id="android-integration" class="hash-header">Android Integration <a href="#android-integration" class="hash-link">#</a></h2> <p>* The plugin will build and run on SDK 16+, but <code>isDeviceSupported()</code> will always return false before SDK 23 (Android 6.0).</p> <h3 id="activity-changes" class="hash-header">Activity Changes <a href="#activity-changes" class="hash-link">#</a></h3> <p>Note that <code>local_auth</code> requires the use of a <code>FragmentActivity</code> instead of an <code>Activity</code>. To update your application:</p> <ul> <li> <p>If you are using <code>FlutterActivity</code> directly, change it to <code>FlutterFragmentActivity</code> in your <code>AndroidManifest.xml</code>.</p> </li> <li> <p>If you are using a custom activity, update your <code>MainActivity.java</code>:</p> <pre><code class="language-java">import io.flutter.embedding.android.FlutterFragmentActivity; public class MainActivity extends FlutterFragmentActivity { // ... } </code></pre> <p>or MainActivity.kt:</p> <pre><code class="language-kotlin">import io.flutter.embedding.android.FlutterFragmentActivity class MainActivity: FlutterFragmentActivity() { // ... } </code></pre> <p>to inherit from <code>FlutterFragmentActivity</code>.</p> </li> </ul> <h3 id="permissions" class="hash-header">Permissions <a href="#permissions" class="hash-link">#</a></h3> <p>Update your project's <code>AndroidManifest.xml</code> file to include the <code>USE_BIOMETRIC</code> permissions:</p> <pre><code class="language-xml"><manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.example.app"> <uses-permission android:name="android.permission.USE_BIOMETRIC"/> <manifest> </code></pre> <h3 id="compatibility" class="hash-header">Compatibility <a href="#compatibility" class="hash-link">#</a></h3> <p>On Android, you can check only for existence of fingerprint hardware prior to API 29 (Android Q). Therefore, if you would like to support other biometrics types (such as face scanning) and you want to support SDKs lower than Q, <em>do not</em> call <code>getAvailableBiometrics</code>. Simply call <code>authenticate</code> with <code>biometricOnly: true</code>. This will return an error if there was no hardware available.</p> <h4 id="android-theme">Android theme</h4> <p>Your <code>LaunchTheme</code>'s parent must be a valid <code>Theme.AppCompat</code> theme to prevent crashes on Android 8 and below. For example, use <code>Theme.AppCompat.DayNight</code> to enable light/dark modes for the biometric dialog. To do that go to <code>android/app/src/main/res/values/styles.xml</code> and look for the style with name <code>LaunchTheme</code>. Then change the parent for that style as follows:</p> <pre><code class="language-xml">... <resources> <style name="LaunchTheme" parent="Theme.AppCompat.DayNight"> ... </style> ... </resources> ... </code></pre> <p>If you don't have a <code>styles.xml</code> file for your Android project you can set up the Android theme directly in <code>android/app/src/main/AndroidManifest.xml</code>:</p> <pre><code class="language-xml">... <application ... <activity ... android:theme="@style/Theme.AppCompat.DayNight" ... > </activity> </application> ... </code></pre> <h2 id="sticky-auth" class="hash-header">Sticky Auth <a href="#sticky-auth" class="hash-link">#</a></h2> <p>You can set the <code>stickyAuth</code> option on the plugin to true so that plugin does not return failure if the app is put to background by the system. This might happen if the user receives a phone call before they get a chance to authenticate. With <code>stickyAuth</code> set to false, this would result in plugin returning failure result to the Dart app. If set to true, the plugin will retry authenticating when the app resumes.</p> </section></div></div></div><aside class="detail-info-box"><a class="packages-scores" href="/packages/local_auth/score"><div class="packages-score packages-score-like"><div class="packages-score-value -has-value"><span class="packages-score-value-number">3.12k</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">likes</div></div><div class="packages-score packages-score-health"><div class="packages-score-value -has-value"><span class="packages-score-value-number">160</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">points</div></div><div class="packages-score packages-score-downloads" title="Number of downloads of this package during the past 30 days"><div class="packages-score-value -has-value"><span class="packages-score-value-number">773k</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">downloads</div></div></a><h3 class="title">Publisher</h3><p><a href="/publishers/flutter.dev"><img class="-pub-publisher-shield filter-invert-on-dark" src="/static/hash-j60jq2j3/img/material-icon-verified.svg" alt="verified publisher" width="14" height="14" title="Published by a pub.dev verified publisher"/>flutter.dev</a></p><h3 class="title">Weekly Downloads</h3><div id="-weekly-downloads-sparkline" class="weekly-downloads-sparkline" data-widget="weekly-sparkline" data-weekly-sparkline-points="gBXzZ7l7AgBzuAIAqdICAJbGAgC4dwIAVqoCAIagAgD5sgIAxIQCAO7ZAgCY4AIAZZoCAM9aAgDeWAEANAIBALU1AgCCyAIAJ+4CAL64AgBYpQIAGbICANeIAgBvgAIA7G8CAJZ/AgBiiwIAUWECABydAgCpYAIAfnYCANCNAgB0dQIAMecCAP90AgAIqAIAPY8CAHvGAgAHegIATnECAP00AgB3wwIAEYECAFVbAgBOLQIAmjECABtLAgCJSQIApAkCAC0XAgBXSQIAM84CAGF4AgA="></div><h3 class="title pkg-infobox-metadata">Metadata</h3><p>Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.</p><p><a class="link" href="https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth" rel="ugc">Repository (GitHub)</a><br/><a class="link" href="https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22" rel="ugc">View/report issues</a><br/><a class="link" href="https://github.com/flutter/packages/blob/main/CONTRIBUTING.md" rel="ugc">Contributing</a><br/></p><h3 class="title">Topics</h3><p><a class="topics-tag" href="/packages?q=topic%3Aauthentication" rel="nofollow">#authentication</a> <a class="topics-tag" href="/packages?q=topic%3Abiometrics" rel="nofollow">#biometrics</a> <a class="topics-tag" href="/packages?q=topic%3Alocal-auth" rel="nofollow">#local-auth</a></p><h3 class="title">Documentation</h3><p><a class="link" href="/documentation/local_auth/latest/">API reference</a><br/></p><h3 class="title">License</h3><p><img class="inline-icon-img filter-invert-on-dark" src="/static/hash-j60jq2j3/img/material-icon-balance.svg" alt="" width="14" height="14" role="presentation"/>BSD-3-Clause (<a href="/packages/local_auth/license">license</a>)</p><h3 class="title">Dependencies</h3><p><a href="https://api.flutter.dev/">flutter</a>, <a href="/packages/local_auth_android" title="^1.0.0">local_auth_android</a>, <a href="/packages/local_auth_darwin" title="^1.4.0">local_auth_darwin</a>, <a href="/packages/local_auth_platform_interface" title="^1.0.1">local_auth_platform_interface</a>, <a href="/packages/local_auth_windows" title="^1.0.0">local_auth_windows</a></p><h3 class="title">More</h3><p><a href="/packages?q=dependency%3Alocal_auth" rel="nofollow">Packages that depend on local_auth</a></p></aside></div><script type="application/ld+json">{"@context":"http\u003a\u002f\u002fschema.org","@type":"SoftwareSourceCode","name":"local\u005fauth","version":"2.3.0","description":"local\u005fauth - Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.","url":"https\u003a\u002f\u002fpub.dev\u002fpackages\u002flocal\u005fauth","dateCreated":"2017-08-17T01\u003a05\u003a33.860860Z","dateModified":"2024-08-06T15\u003a27\u003a00.675250Z","programmingLanguage":"Dart","image":"https\u003a\u002f\u002fpub.dev\u002fstatic\u002fimg\u002fpub-dev-icon-cover-image.png","license":"https\u003a\u002f\u002fpub.dev\u002fpackages\u002flocal\u005fauth\u002flicense"}</script></div><div class="detail-metadata"><h3 class="detail-metadata-title"><span class="detail-metadata-toggle">←</span> Metadata</h3><div class="detail-info-box"><a class="packages-scores" href="/packages/local_auth/score"><div class="packages-score packages-score-like"><div class="packages-score-value -has-value"><span class="packages-score-value-number">3.12k</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">likes</div></div><div class="packages-score packages-score-health"><div class="packages-score-value -has-value"><span class="packages-score-value-number">160</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">points</div></div><div class="packages-score packages-score-downloads" title="Number of downloads of this package during the past 30 days"><div class="packages-score-value -has-value"><span class="packages-score-value-number">773k</span><span class="packages-score-value-sign"></span></div><div class="packages-score-label">downloads</div></div></a><h3 class="title">Publisher</h3><p><a href="/publishers/flutter.dev"><img class="-pub-publisher-shield filter-invert-on-dark" src="/static/hash-j60jq2j3/img/material-icon-verified.svg" alt="verified publisher" width="14" height="14" title="Published by a pub.dev verified publisher"/>flutter.dev</a></p><h3 class="title">Weekly Downloads</h3><div id="-weekly-downloads-sparkline" class="weekly-downloads-sparkline" data-widget="weekly-sparkline" data-weekly-sparkline-points="gBXzZ7l7AgBzuAIAqdICAJbGAgC4dwIAVqoCAIagAgD5sgIAxIQCAO7ZAgCY4AIAZZoCAM9aAgDeWAEANAIBALU1AgCCyAIAJ+4CAL64AgBYpQIAGbICANeIAgBvgAIA7G8CAJZ/AgBiiwIAUWECABydAgCpYAIAfnYCANCNAgB0dQIAMecCAP90AgAIqAIAPY8CAHvGAgAHegIATnECAP00AgB3wwIAEYECAFVbAgBOLQIAmjECABtLAgCJSQIApAkCAC0XAgBXSQIAM84CAGF4AgA="></div><h3 class="title pkg-infobox-metadata">Metadata</h3><p>Flutter plugin for Android and iOS devices to allow local authentication via fingerprint, touch ID, face ID, passcode, pin, or pattern.</p><p><a class="link" href="https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth" rel="ugc">Repository (GitHub)</a><br/><a class="link" href="https://github.com/flutter/flutter/issues?q=is%3Aissue+is%3Aopen+label%3A%22p%3A+local_auth%22" rel="ugc">View/report issues</a><br/><a class="link" href="https://github.com/flutter/packages/blob/main/CONTRIBUTING.md" rel="ugc">Contributing</a><br/></p><h3 class="title">Topics</h3><p><a class="topics-tag" href="/packages?q=topic%3Aauthentication" rel="nofollow">#authentication</a> <a class="topics-tag" href="/packages?q=topic%3Abiometrics" rel="nofollow">#biometrics</a> <a class="topics-tag" href="/packages?q=topic%3Alocal-auth" rel="nofollow">#local-auth</a></p><h3 class="title">Documentation</h3><p><a class="link" href="/documentation/local_auth/latest/">API reference</a><br/></p><h3 class="title">License</h3><p><img class="inline-icon-img filter-invert-on-dark" src="/static/hash-j60jq2j3/img/material-icon-balance.svg" alt="" width="14" height="14" role="presentation"/>BSD-3-Clause (<a href="/packages/local_auth/license">license</a>)</p><h3 class="title">Dependencies</h3><p><a href="https://api.flutter.dev/">flutter</a>, <a href="/packages/local_auth_android" title="^1.0.0">local_auth_android</a>, <a href="/packages/local_auth_darwin" title="^1.4.0">local_auth_darwin</a>, <a href="/packages/local_auth_platform_interface" title="^1.0.1">local_auth_platform_interface</a>, <a href="/packages/local_auth_windows" title="^1.0.0">local_auth_windows</a></p><h3 class="title">More</h3><p><a href="/packages?q=dependency%3Alocal_auth" rel="nofollow">Packages that depend on local_auth</a></p></div><p class="detail-lead-back"><a class="detail-metadata-toggle">Back</a></p></div><div id="-screenshot-carousel" class="carousel"><fab id="-carousel-prev" class="mdc-fab carousel-prev carousel-nav" data-mdc-auto-init="MDCRipple" title="Previous" data-ga-click-event="screenshot-carousel-prev-click" tabindex="0"><div class="mdc-fab__ripple"></div><img class="mdc-fab__icon" src="/static/hash-j60jq2j3/img/keyboard_arrow_left.svg" alt="previous" width="24" height="24" aria-hidden="true"/></fab><div id="-image-container" class="image-container"></div><fab id="-carousel-next" class="mdc-fab carousel-next carousel-nav" data-mdc-auto-init="MDCRipple" title="Next" data-ga-click-event="screenshot-carousel-next-click" tabindex="0"><div class="mdc-fab__ripple"></div><img class="mdc-fab__icon" src="/static/hash-j60jq2j3/img/keyboard_arrow_right.svg" alt="next" width="24" height="24" aria-hidden="true"/></fab><p id="-screenshot-description" class="screenshot-description"></p></div></main><footer class="site-footer"><a class="link" href="https://dart.dev/">Dart language</a><a class="link sep" href="/report?subject=package%3Alocal_auth&url=https%3A%2F%2Fpub.dev%2Fpackages%2Flocal_auth">Report package</a><a class="link sep" href="/policy">Policy</a><a class="link sep" href="https://www.google.com/intl/en/policies/terms/">Terms</a><a class="link sep" href="https://developers.google.com/terms/">API Terms</a><a class="link sep" href="/security">Security</a><a class="link sep" href="https://www.google.com/intl/en/policies/privacy/">Privacy</a><a class="link sep" href="/help">Help</a><a class="link icon sep" href="/feed.atom"><img class="inline-icon" src="/static/hash-j60jq2j3/img/rss-feed-icon.svg" alt="RSS" width="20" height="20" title="RSS/atom feed"/></a><a class="link icon github_issue" href="https://github.com/dart-lang/pub-dev/issues/new"><img class="inline-icon" src="/static/hash-j60jq2j3/img/bug-report-white-96px.png" alt="bug report" width="20" height="20" title="Report an issue with this site"/></a></footer><script src="/static/hash-j60jq2j3/highlight/highlight-with-init.js" defer="defer"></script></body></html>