Local Authentication
Beto, March 17, 2022 · 0 views
I demonstrate how to implement local authentication in a React Native app using Expo. It’s designed for developers who want to secure their apps by using biometric or device-based authentication methods like fingerprint, face ID, or device passcodes. The example app’s UI is inspired by a popular community Figma kit for personal finance apps, giving it a clean and user-friendly look.
You’ll learn how to install the necessary Expo dependencies and use the API to check device capabilities and prompt users for authentication. This approach leverages native device security features, making your app both secure and easy to use without relying on passwords.
What's inside
- Why local authentication matters in mobile apps
- Installing Expo dependencies for local authentication
- Using expo-local-authentication API to check and prompt authentication
- Handling different authentication types (biometrics, passcode)
- Example app design inspiration from a Figma UI kit
- Simple and effective authentication flows
- Links to source code and downloads
Why local authentication matters in mobile apps
Protecting your app from unauthorized access is essential, especially when dealing with sensitive user data. Local authentication uses the device’s built-in security features, such as fingerprint scanners or face recognition, to verify users quickly and securely. This method reduces the need for passwords, which can be forgotten or compromised.
Using local authentication improves user experience by providing a fast and seamless way to unlock the app. It also leverages hardware-level security, which is generally more robust than software-only solutions. I emphasize that sometimes the simplest authentication method - using what the device already offers - is the best choice for many apps.
Installing Expo dependencies for local authentication
To implement local authentication, you need to install two Expo packages:
- : Provides access to biometric and device authentication APIs.
- : Used for rendering vector graphics in the app’s UI.
You can add these dependencies with the following commands:
These packages enable your app to interact with native authentication features and build a polished interface that includes scalable graphics.
Using expo-local-authentication API to check and prompt authentication
The core functionality relies on the API, which allows you to:
- Detect if the device supports local authentication methods like biometrics or passcode.
- Prompt the user to authenticate using the available method.
- Handle the authentication result to grant or deny access accordingly.
This API abstracts away platform-specific details, so you don’t have to write separate code for iOS and Android. It simplifies integrating native authentication flows, making your app more secure with minimal effort.
Handling different authentication types (biometrics, passcode)
The app dynamically checks which authentication types are available on the device, such as fingerprint, face ID, or device passcode. Based on this detection, it triggers the appropriate prompt to the user.
This flexibility ensures your app works smoothly across a wide range of devices and user preferences. Whether a user prefers biometrics or passcodes, your app can adapt and provide a seamless authentication experience without manual configuration.
Example app design inspiration from a Figma UI kit
The UI design is inspired by the Expenio personal finance UI kit, a community-created Figma file. This design choice gives the app a modern, clean look focused on usability and clarity.
Using community design resources like this can speed up your development process and improve the visual appeal of your app. It’s a practical way to build professional-looking interfaces without starting from scratch.
Simple and effective authentication flows
Local authentication can be straightforward yet highly effective. Instead of building complex multi-step login flows, you can rely on the device’s security features to verify users quickly.
This approach reduces friction for users, providing a smooth experience while maintaining strong protection. It’s ideal for apps that need fast user verification without the hassle of passwords or additional steps.
Links to source code and downloads
The full source code and project files are available on GitHub. I description includes direct links to:
- The GitHub repository for the Expo local authentication app.
- A ZIP download of the entire project.
These resources let you get started quickly and customize the app to fit your specific needs.
Resources

CourseReact Native course
Fundamentals through shipping: the concepts behind the prompts, with lifetime access.

YouTubeLocal Authentication with Expo
Watch the full video demo and explanation on YouTube.
Like this article? Get the rest of the library plus weekly React Native tips. Free.