A modern React Native mobile application built with Expo and SDK 50+ demonstrating how to implement secure biometric authentication (Face ID, Fingerprint, and Iris Scan) for both iOS and Android.
This app provides a boilerplate for implementing a "Security First" flow. It checks for hardware compatibility, verifies if biometrics are enrolled, and triggers the native OS authentication prompts.
- Device Support Check: Detects if the device has biometric hardware.
- Enrollment Check: Verifies if the user has fingerprints or faces registered.
- Cross-Platform: Seamless Face ID for iOS and Fingerprint/Face unlock for Android.
- Graceful Fallback: Support for device PIN/Passcode if biometrics fail.
- Modern UI: Built with
Lucide-react-nativeicons and clean layout.
- Node.js (v18 or newer)
- Expo Go app on your device (for basic testing)
- EAS CLI installed globally (
npm install -g eas-cli)
-
Clone the repository
git clone https://github.com/SasadaSaumya/biometric-auth-app.git cd biometric-auth-app -
Install dependencies
npm install
-
Configure permissions Ensure your
app.jsonincludes the Face ID permission (already configured in this repo):"ios": { "infoPlist": { "NSFaceIDUsageDescription": "Allow BiometricAuth to use Face ID for secure login." } }
├── assets/ # Static files (images/icons)
├── src/
│ ├── services/
│ │ └── authService.js # Biometric logic & Hardware checks
│ └── screens/
│ ├── LoginScreen.js # Entry screen with auth trigger
│ └── HomeScreen.js # Protected content (Post-auth)
├── App.js # State management & Navigation
├── app.json # Expo configuration
└── package.json
You can test on a physical device or an emulator.
- For emulators: Go to Extended Controls (...) > Fingerprint to simulate a touch.
npx expo startImportant: Face ID cannot be tested in the standard "Expo Go" app from the App Store because it requires a custom Info.plist. To test Face ID, you must create a Development Build:
- Create a build (requires a free Expo account):
npx expo run:ios # OR for a cloud build: eas build --profile development --platform ios - Install the resulting build on your device/simulator.
- Start the dev server:
npx expo start --dev-client
expo-local-authentication: The core biometric library.lucide-react-native: Beautiful, lightweight icons.expo-secure-store: (Recommended for production) To store sensitive tokens after authentication.
- Level Verification: This app checks for
BIOMETRIC_STRONG. Always ensure you aren't allowing "Weak" biometrics (like 2D face photos) for sensitive actions. - Fallback: Always provide a manual Password/PIN option in case the biometric hardware is damaged.
- No Local Storage: Never store "True/False" login status in
AsyncStorage. Use a secure token that is only released upon successful biometric callback.
This project is licensed under the MIT License - see the LICENSE file for details.
Sasada Saumya
- GitHub: @SasadaSaumya
- LinkedIn: SasandaSaumya