A React Native Expo application demonstrating secure authentication using:
- Email & Password Login
- Fingerprint Authentication
- Face ID Authentication
- 4-Digit Passcode Authentication
- Secure Storage using Expo Secure Store
- Authentication Settings Management
- Create new account
- Validate email format
- Password confirmation
- Store user information securely using Expo Secure Store
- Login using Email & Password
- Validate registered credentials
- Navigate to biometric setup for first-time users
- Direct login for users with biometrics enabled
Supports:
- Fingerprint
- Face ID
- Device Credentials (Passcode/Pattern)
Checks:
- Device hardware support
- Biometric enrollment
- User authentication
- Secure enable/disable flow
- Create 4-digit passcode
- Login using passcode
- Change passcode
- Remove passcode (after biometric verification)
Manage authentication preferences:
- Enable/Disable Biometric Login
- Create Passcode
- Change Passcode
- Remove Passcode
- Logout
Splash
│
├── Logged In
│ │
│ ├── Biometrics Enabled
│ │ │
│ │ └── Authenticate
│ │ │
│ │ └── Home
│ │
│ └── Login
│
└── Welcome
│
├── Register
│ │
│ ├── Create Passcode
│ ├── Enable Biometrics
│ └── Home
│
└── Login
│
├── Email & Password
├── Biometrics
└── Passcode
- Splash Screen
- Welcome Screen
- Register Screen
- Login Screen
- Create Passcode Screen
- Passcode Login Screen
- Enable Biometric Screen
- Authentication Loading Screen
- Home Screen
- Settings Screen
src
│
├── navigation
│ └── AppNavigator.tsx
│
├── screens
│ ├── SplashScreen.tsx
│ ├── WelcomeScreen.tsx
│ ├── RegisterScreen.tsx
│ ├── LoginScreen.tsx
│ ├── CreatePasscodeScreen.tsx
│ ├── PasscodeLoginScreen.tsx
│ ├── EnableBiometricScreen.tsx
│ ├── AuthLoadingScreen.tsx
│ ├── HomeScreen.tsx
│ └── SettingsScreen.tsx
│
├── storage
│ └── biometricStorage.ts
|
├── utils
│ └── biometric.ts
│
└── assets
- Expo
- React Native
- TypeScript
- React Navigation
- Expo Local Authentication
- Expo Secure Store
Clone the repository:
git clone https://github.com/dainyjose/biometric-auth-mobile.gitInstall dependencies:
npm installStart Expo:
npx expo startRun Android:
npx expo run:androidRun iOS:
npx expo run:iosnpx expo install expo-local-authentication
npx expo install expo-secure-store
npm install @react-navigation/native
npm install @react-navigation/native-stackThe application securely stores:
| Key | Description |
|---|---|
| user_data | Registered user details |
| biometric_enabled | Biometric login status |
| user_passcode | User passcode |
| is_logged_in | Login session |
This project is intended for learning and demonstration purposes.
Production applications should:
- Never store plaintext passwords.
- Authenticate users through a backend server.
- Store authentication tokens instead of passwords.
- Encrypt sensitive data.
- Implement token refresh and expiration.
- Use certificate pinning for API communication.
- Follow OWASP Mobile Application Security guidelines.
- Forgot Password
- Change Password
- Multiple User Support
- Passcode Retry Limits
- Biometric Lockout Handling
- Session Timeout
- Auto Logout
- JWT Authentication
- Backend API Integration
- Refresh Tokens
- Dark Mode Support
This project is provided for educational purposes.