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, Face ID, etc on a BrowserStack mobile device.
In this guide, you will learn about :
- How to test Biometric authentication in an App Automate session
- Frequently Asked Questions (FAQs)
1. How to test Biometric authentication in an App Automate session
To test Biometric Authentication feature in your mobile apps, follow the below outlined steps :
1.1 Enable Biometric Authentication in the Appium Session
Use BrowserStack’s Appium capability to enable Biometric in a BrowserStack Appium session.
This ensures your app undergoes Sensor Instrumentation which is a process using which BrowserStack supports app’s interaction with different mobile sensors such as Biometric.
If you are using BrowserStack SDK, you can set the following capability within the browserstack.yml
file:
Capability | Description | Expected values |
---|---|---|
enableBiometric |
Enable Biometric Authentication |
true /false
|
BrowserStack SDK is a plug-n-play solution that takes care of all the integration steps for you. Using the BrowserStack SDK is the recommended integration method for your project. To know more, visit the SDK core concepts page.
Use the following code snippet to enable Biometric Authentication:
Capability | Description | Expected values |
---|---|---|
enableBiometric |
Enable Biometric Authentication |
true /false
|
DesiredCapabilities capabilities = new DesiredCapabilities();
HashMap<String, Object> browserstackOptions = new HashMap<String, Object>();
browserstackOptions.put("enableBiometric", "true");
var capabilities = {
'bstack:options' : {
"enableBiometric" : "true",
},
}
desired_cap = {
'bstack:options' : {
"enableBiometric" : "true",
},
}
capabilities = {
'bstack:options' => {
"enableBiometric" => "true",
},
}
AppiumOptions capabilities = new AppiumOptions();
Dictionary<string, object> browserstackOptions = new Dictionary<string, object>();
browserstackOptions.Add("enableBiometric", "true");
Capability | Description | Value |
---|---|---|
browserstack.enableBiometric |
Enable Biometric Authentication |
true /false
|
DesiredCapabilities desiredCapabilities = new DesiredCapabilities();
desiredCapabilities.setCapability("browserstack.enableBiometric", "true");
var capabilities = {
"browserstack.enableBiometric" : "true"
}
desired_cap = {
"browserstack.enableBiometric" : "true"
}
desired_caps = {
"browserstack.enableBiometric" => "true"
}
DesiredCapabilities capability = new DesiredCapabilities();
desiredCapabilities.SetCapability("browserstack.enableBiometric", "true");
1.2 Use BrowserStack’s custom executor to interact with Biometric authentication dialog
When your app, which is BrowserStack sensor instrumented, presents Biometric Authentication alert use our custom executor with action biometric
& arguments {"biometricMatch": "pass"}
to interact with the alert as shown below :
driver.executeScript("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
\"biometricMatch\" : \"pass\"
}}”)
await driver.execute("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
\"biometricMatch\" : \"pass\"
}}”)
driver.execute_script("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
\"biometricMatch\" : \"pass\"
}}”)
@driver.execute_script("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
\"biometricMatch\" : \"pass\"
}}”)
driver.executeScript("browserstack_executor: {\"action\":\"biometric\", \"arguments\": {
\"biometricMatch\" : \"pass\"
}}”)
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?
Please note that Biometric feature will work only if the app uses any of the following supported Biometric APIs. To get more details about the Biometric APIs your app uses please check with your app development team.
On Android, currently we support the following Biometric APIs in Android SDK :
-
BiometricPrompt
API. For more details, please check BiometricPrompt Google documentation. -
BiometricManager
API. For more details, please check BiometricManager Google documentation. -
KeyguardManager
API. For more details, please check KeyguardManager Google documentation. -
FingerprintManager
API. For more details, please check FingerprintManager Google documentation.
On iOS, currently we support the following Biometric APIs in iOS SDK :
-
canEvaluatePolicy
&evaluatePolicy
APIs from theLAContext
class in the Apple’s iOS Biometric SDK. For more details, please check LAContext Apple documentation.
- Currently, we don’t support apps using iOS Keychain APIs with Biometric access control. For more details, check Apple documentation on Keychain access with Biometric authentication.
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.
4. What kind of apps are supported?
We support native apps & apps built with cross platform frameworks such as React Native, Flutter, etc.
- Biometric feature is supported only on Android 6.0 & above
- Apps using code obfuscation tools such as Proguard are not supported
- Biometric feature is supported only on iOS 13 & above devices.
- iOS apps signed with Enterprise certificates are not supported. Biometric feature needs
browserstack.resignApp
to betrue
.
Related topics
Check this page for a list of various JavaScript Executors that BrowserStack offers.
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!