feat: add flet-local-auth extension - #6823
Conversation
Switch the dev client and flet build template to FlutterFragmentActivity, which local_auth requires for biometric dialogs on Android. Re-parent LaunchTheme to Theme.AppCompat.DayNight.NoActionBar in light and night styles so the biometric dialog does not crash on API 24-27. Add a biometric cross-platform permission bundle for NSFaceIDUsageDescription on iOS and macOS builds, document FlutterFragmentActivity R8 keep rules, and note Touch ID signing requirements in macOS publish docs. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Remove flet-local-auth references from the host PR so docs build passes before the extension lands. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Add the flet-local-auth service wrapping local_auth 3.0.2 with upstream-parity LocalAuthException handling, platform auth message types, docs, example, and integration tests. Depends on the Android host FlutterFragmentActivity / AppCompat LaunchTheme changes in the base branch. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
local_auth 3.x simplified AndroidAuthMessages and IOSAuthMessages and removed customizable Windows dialog strings. Update Python @ft.value types and Dart parsers to match the pinned platform packages. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Document sandbox, signing, and SecureStorage entitlement notes alongside the extension service docs. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Map local_auth 3.x iris biometrics in the Python enum and add NSFaceIDUsageDescription to the macOS dev client Info.plist. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Place Unreleased entries under 1.0.0 after rebasing onto main, and document FlutterFragmentActivity keep rules now that the ProGuard section exists. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
|
|
|
Thanks for putting this together! The API is clear, the wrapper follows upstream closely, and I appreciate the work on packaging, client registration, docs, and examples. I found two things to fix before merging:
The tests currently cover capability queries and enum mappings, but don’t exercise authentication. Could you add coverage for successful/unsuccessful results and exception translation, and share which platforms you’ve tested an actual authentication prompt on? The overall approach looks sound—these are targeted fixes, with no redesign needed. |
…ission FlutterFragmentActivity switches from LaunchTheme to NormalTheme after startup, so API 24-27 biometric dialogs still need an AppCompat parent. Also add permissions = ["biometric"] to the example so iOS/macOS builds get NSFaceIDUsageDescription, and cover exception translation in tests. Co-authored-by: Corey McCrea <mccre110@users.noreply.github.com>
Thanks for the review. I’ve pushed fixes for both merge blockers:
Not covered:
Manual System Prompt Testing:Windows 11macOS 26iOS 26Android 15 |







Description
Adds the
flet-local-authextension with aLocalAuthenticationservice for on-device biometric and credential authentication on Android, iOS, macOS, and Windows vialocal_auth3.0.2. Linux and Web are explicitly unsupported.Also includes the Android host changes this extension needs:
FlutterFragmentActivityand AppCompatLaunchThemeso biometric dialogs work on API 24–27biometriccross-platform permission bundle forNSFaceIDUsageDescriptionon iOS and macOSNSFaceIDUsageDescriptionin the iOS and macOS dev clientsAPI:
is_device_supported(),can_check_biometrics(),get_available_biometrics()authenticate()— raisesLocalAuthExceptionon failure (upstreamlocal_authparity)stop_authentication()AndroidAuthMessages,IOSAuthMessages, etc.) aligned withlocal_auth3.xIncludes Python package, Flutter extension, client registration, CI, docs, example, and integration tests.
Related: closes #3192 (supersedes closed #3682). Retarget of closed #6759 onto
mainafterrelease/flet-1.0was removed.Test code
Integration tests:
sdk/python/packages/flet/integration_tests/extensions/local_auth/test_local_auth.py
Type of change
Checklist
website/sidebars.ymlfor breaking changes, removals, and deprecations, if applicable.Screenshots
Service invokes the OS biometric modal; no custom Flet UI.
Additional details
N/A
Summary by Sourcery
Add cross-platform local biometric and device-credential authentication to Flet through a new
flet-local-authextension.New Features:
flet-local-authextension, exposing on-device biometric and credential authentication for Android, iOS, macOS, and Windows.Enhancements:
biometricpermission bundle and required Apple Face ID usage descriptions.Build:
CI:
flet-local-authin CI package validation.Documentation:
Tests:
Chores: