Skip to content

[local_auth_android] UI for password authentication shows text for biometric authentication #132757

@kputh

Description

@kputh

Is there an existing issue for this?

Steps to reproduce

  1. Checkout https://github.com/flutter/packages/tree/main/packages/local_auth/local_auth/example
  2. Go to this line in your workspace
  3. Add AndroidAuthMessages with a recognizable biometricHint set.
  4. Run the app and trigger non-biometric authentication.

(I have not tested these steps to reproduce the issue. It seems like an easy-to-reproduce bug, and the package's own repository seemed to a trustworthy source of example code.)

Expected results

The UI should not show the text you entered for biometricHint, because you and not in a biometric authentication flow.

Actual results

Your biometricHint appears in the PIN/password authentication screen. (See attached screenshot)

Code sample

Code sample
import 'package:local_auth_android/local_auth_android.dart';
// ···
    final bool didAuthenticate = await auth.authenticate(
        localizedReason: 'Please authenticate to show account balance',
        authMessages: const <AuthMessages>[
          AndroidAuthMessages(
            biometricHint: 'This is AndroidAuthMessages.biometricHint',
          ),
        ]);

Screenshots or Video

Screenshots / Video demonstration

local_auth localization

This screenshot shows local_auth's PIN/password authentications screen with all localizable text replaced by the corresponding fields' names in AndroidAuthMessages.

Flutter Doctor output

Doctor output
[✓] Flutter (Channel stable, 3.10.6, on macOS 13.4.1 22F770820d darwin-x64, locale de-DE)
    • Flutter version 3.10.6 on channel stable at /Users/kaiputh/flutter
    • Upstream repository https://github.com/flutter/flutter.git
    • Framework revision f468f3366c (5 weeks ago), 2023-07-12 15:19:05 -0700
    • Engine revision cdbeda788a
    • Dart version 3.0.6
    • DevTools version 2.23.1

[✓] Android toolchain - develop for Android devices (Android SDK version 33.0.1)
    • Android SDK at /Users/kaiputh/Library/Android/sdk
    • Platform android-33, build-tools 33.0.1
    • Java binary at: /Users/kaiputh/Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 14.3.1)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 14E300c
    • CocoaPods version 1.12.1

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Users/kaiputh/Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] IntelliJ IDEA Ultimate Edition (version 2023.2)
    • IntelliJ at /Users/kaiputh/Applications/IntelliJ IDEA Ultimate.app
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart

[✓] VS Code (version 1.74.1)
    • VS Code at /Users/kaiputh/Downloads/Visual Studio Code.app/Contents
    • Flutter extension can be installed from:
      🔨 https://marketplace.visualstudio.com/items?itemName=Dart-Code.flutter

[✓] Connected device (3 available)
    • sdk gphone64 x86 64 (mobile) • emulator-5554 • android-x64    • Android 13 (API 33) (emulator)
    • macOS (desktop)              • macos         • darwin-x64     • macOS 13.4.1 22F770820d darwin-x64
    • Chrome (web)                 • chrome        • web-javascript • Google Chrome 115.0.5790.170

[✓] Network resources
    • All expected network resources are available.

• No issues found!

Metadata

Metadata

Labels

P2Important issues not at the top of the work listfound in release: 3.13Found to occur in 3.13found in release: 3.14Found to occur in 3.14has reproducible stepsThe issue has been confirmed reproducible and is ready to work onp: local_authPlugin for local authentificationpackageflutter/packages repository. See also p: labels.platform-androidAndroid applications specificallyr: fixedIssue is closed as already fixed in a newer versionteam-androidOwned by Android platform teamtriaged-androidTriaged by Android platform team

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions