Biometric login
Overview
Authgear supports enabling biometric login in the native mobile application. To set this up, you will need to
Enable biometric login in your application.
Sign up or log in a user in your mobile application, use the mobile SDK to enable biometric login.
Enable biometric login in your application
In the portal, go to "Biometric Authentication".
Turn on "Enable biometric authentication".
Click "Save".
authentication:
identities:
...
# Add biometric along with the other enabled identities
- biometric
identity:
biometric:
# Enable listing biometric login in user setting page, default false
list_enabled: trueEnable biometric login in mobile SDK
In the following section, we will show you how to use biometric login in the SDK. In the SDK code snippet, authgear is referring to the configured Authgear container.
Check if the current device supports biometric login before calling any biometric API.
// check if current device supports biometric login
var supported = false
do {
try authgear.checkBiometricSupported()
supported = true
} catch {}
if supported {
// biometric login is supported
}boolean supported = false;
try {
// biometric login is supported SDK_INT >= 23 (Marshmallow)
if (Build.VERSION.SDK_INT >= 23) {
// check if current device supports biometric login
authgear.checkBiometricSupported(
this.getApplication(),
ALLOWED
);
supported = true;
}
} catch (Exception e) {}
if (supported) {
// biometric login is supported
}Enable biometric login for logged in user
Check if the current device enabled biometric login, we should check this before asking the user to log in with biometric credentials
Login with biometric credentials
Disable biometric login in the current device
Error handling
Last updated
Was this helpful?