Test biometric authentication on BrowserStack mobile devices
The majority of mobile devices today support biometric hardware sensors to authenticate device owner’s identity. BrowserStack enables you to test biometric authentication such as touch ID/fingerprint sensor and face ID on a BrowserStack mobile device with Espresso framework.
Supported OS and version
OS | Version |
---|---|
Android | 6.0 and higher |
- Native apps & apps built with cross platform frameworks such as React Native, Flutter, etc. are supported.
- However, apps using code obfuscation tools such as Proguard are not supported.
Enabling Biometric Authentication
Use BrowserStack parameter enableBiometric
and set it to true
in the REST API request to enable Biometric Authentication functionality for your Espresso test session.
This ensures your app undergoes Sensor Instrumentation, which is a process that supports app’s interaction with biometric mobile sensors on BrowserStack real devices.
Example request
curl -u "username:accesskey" \
-X POST "https://api-cloud.browserstack.com/app-automate/espresso/v2/build"
\ -d '{
"enableBiometric": "true",
"devices": ["Samsung Galaxy S8-7.0"],
"app": "bs://f5L3azt9pLzE995f49376eb1fa3c284dc321f8d",
"testSuite": "bs://6eb1fa3c284ddbe9971b2d1aee0d52943b9c081"}'
\ -H "Content-Type: application/json"
Test Biometric Authentication after enabling it
When you trigger the Biometric Authentication test workflow in your app, the below BrowserStack prompt would show up. You can click on Pass
or Fail
to succeed or fail the authentication respectively.
Frequently Asked Questions (FAQs)
1. How does Biometric Authentication work on BrowserStack mobile devices?
BrowserStack supports an app’s interaction with different mobile sensors such as biometric using Sensor Instrumentation. Sensor Instrumentation is the process in which, if biometric is enabled for the session, we inject BrowserStack’s biometric code module into the app, which mocks or overrides Biometric APIs used by the app.
2. What Biometric APIs are supported by BrowserStack Biometric feature?
The BrowserStack Biometric feature works only if the app uses any of the following supported Biometric APIs. Check with your app development team for details about the Biometric APIs your app uses.
We currently support the following Biometric APIs in Android SDK :
-
BiometricPrompt
API. For more details, check out BiometricPrompt Google documentation. -
BiometricManager
API. For more details, check out BiometricManager Google documentation. -
KeyguardManager
API. For more details, check out KeyguardManager Google documentation. -
FingerprintManager
API. For more details, check out FingerprintManager Google documentation.
3. Do we need to register biometric on the mobile device or make any changes in the app code?
No. You do not need to register any biometric on the mobile device or make any changes in the app code.
Need some help?
If you have any queries, please get in touch with us.
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
We're sorry to hear that. Please share your feedback so we can do better
Contact our Support team for immediate help while we work on improving our docs.
We're continuously improving our docs. We'd love to know what you liked
Thank you for your valuable feedback!