Get User Consent For LDA
Overview of getUserConsentForLDA
getUserConsentForLDA
If the get user consent challenge has been configured, the getUserConsentForLDA
event is triggered by the SDK during:
- π First-time device activation
- π New device activation
- π Passwordless login flows with optional LDA setup
π― Purpose:
To explicitly request the user's permission to enable Local Device Authentication (LDA) (e.g., FaceID, Fingerprint, Pattern, Passcode) for secure, fast, and convenient future logins.
Consent ensures user privacy and maintains the security and regulatory requirements around biometric data usage.
Relevant Payload Fields
Field | Description |
---|---|
userID | ID of the user |
challengeMode | Mode of operation (Auto / Manual) |
authenticationType | Type of authentication requested |
challengeInfo | Optional additional challenge info |
error | Standard error object if any |
π± User Consent for LDA - Screen Design on Receiving getUserConsentForLDA
getUserConsentForLDA
π§© Purpose of the Screen
When the SDK triggers the getUserConsentForLDA
event, the mobile app must prompt the user to grant or deny consent for enabling Local Device Authentication (LDA) β such as FaceID, Fingerprint, Pattern, or Device Passcode.
This ensures user trust, privacy compliance, and enhanced authentication experience.
π¨ What the Consent Screen Must Include
Section | Description |
---|---|
Title | Enable Device Authentication |
Message / Description | A brief explanation asking if the user wishes to use their deviceβs security features for quicker and secure login. |
Primary Button (Allow) | Label: "Allow" β to agree to LDA usage. |
Secondary Button (Decline) | Label: "Decline" β to decline using LDA. |
Optional Icons | Based on authenticationType , show an icon (FaceID, Fingerprint, Pattern, PIN). |
Optional Subtext | "You can change this later in Settings." |
β¨ Example Text Content
Header:
Enable Device Authentication
Body Message:
Would you like to use your deviceβs security (FaceID, Fingerprint, Pattern, or Passcode) for quicker and secure login?
Buttons:
- Allow (Proceed with LDA)
- Decline (Fallback to password login)
π Dynamic Screen Adjustments (Based on Authentication Type)
authenticationType | What to Show on Screen |
---|---|
1 - Fingerprint | Show fingerprint icon and message "Use your fingerprint for secure login?" |
2 - FaceID | Show FaceID icon and message "Use FaceID for authentication?" |
3 - Pattern | Show a pattern unlock graphic |
8 - Passcode | Show PIN/keypad graphic and PIN entry messaging |
10 - Best Available Biometric | Dynamically adapt to device capability |
6 - External Biometric Opt-In | ?? |
7 - External Biometric Opt-Out | ?? |
π‘οΈ Important Notes
- Consent must be explicitly collected before enabling LDA.
- UX Tip: Keep the language user-friendly and reassuring about security benefits.
Submitting the User LDA Consent
The setUserConsentForLDA
API is called to submit the user's consent decision for enabling Local Device Authentication (LDA) such as FaceID, Fingerprint, Pattern Lock, or Device Passcode.
This API must be called in response to the getUserConsentForLDA
event.
π οΈ Parameters
Parameter | Type | Description |
---|---|---|
consent | boolean | true if the user agrees to enable LDA, false if declined |
challengeMode | number | Challenge mode received from the getUserConsentForLDA event |
authenticationType | number | Authentication type requested (e.g., Fingerprint, FaceID), pass the same as received in getUserConsentForLDA |
π― Behavior
On calling the API setUserConsentForLDA, the SDK will decide the next steps.
-
If
consent = true
: SDK will initiate LDA (FaceID/Fingerprint/Pattern/Passcode) authentication. -
If
consent = false
: SDK will fallback and triggergetPassword
event. If LDA is mandated in the Gateway manager, then the SDK will fail the challenge and callgetUser
event. -
On Biometric Success: SDK Triggers
onUserLoggedIn
event. -
On Biometric Failure: SDK Triggers
getPassword
fallback event.
Code Snippets
π React Native
import { NativeEventEmitter, NativeModules } from 'react-native';
const eventEmitter = new NativeEventEmitter(NativeModules.RdnaClient);
eventEmitter.addListener('getUserConsentForLDA', (response) => {
const { userID, challengeMode, authenticationType } = response;
RdnaClient.setUserConsentForLDA(true, challengeMode, authenticationType, (syncResponse) => {});
});
π£ Flutter
import 'package:flutter_rdna/flutter_rdna.dart';
rdnaClient.on(RdnaClient.getUserConsentForLDA, (response) {
String userId = response['userID'];
int challengeMode = response['challengeMode'];
int authenticationType = response['authenticationType'];
rdnaClient.setUserConsentForLDA(true, challengeMode, authenticationType);
});
π§© Cordova
document.addEventListener('getUserConsentForLDA', function(response) {
const { userID, challengeMode, authenticationType } = response;
com.uniken.rdnaplugin.RdnaClient.setUserConsentForLDA(
successCallback,
errorCallback,
[true, challengeMode, authenticationType]
);
}, false);
π iOS (Objective-C)
- (void)getUserConsentForLDA:(NSString *)userID
challengeMode:(RDNAChallengeOpMode)challengeMode
authenticationType:(RDNALDACapabilities)authenticationType
info:(NSArray<RDNAChallengeInfo*> *)info
error:(RDNAError *)error {
[rdnaClient setUserConsentForLDA:YES challengeMode:challengeMode authenticationType:authenticationType];
}
π€ Android (Java)
@Override
public void getUserConsentForLDA(String userID, RDNA.RDNAChallengeOpMode mode,
RDNA.RDNALDACapabilities authType, HashMap<String, String> info, RDNA.RDNAError error) {
rdnaClient.setUserConsentForLDA(true, mode, authType);
}
Sample Response of setUserConsentForLDA
setUserConsentForLDA
{
"userID": "[email protected]",
"challengeMode": 1,
"authenticationType": 2,
"challengeInfo": [],
"error": {
"longErrorCode": 0,
"shortErrorCode": 0,
"errorString": "Success"
}
}
8. Error Codes and Actions - validate
Error Code | Meaning | Action |
---|---|---|
89 | User canceled biometric | Show password fallback |
90 | System canceled biometric | Retry or fallback |
91 | Biometric locked out | Password fallback |
92 | Face recognition canceled | Retry or fallback |
93 | Face recognition canceled by system | Retry or fallback |
94 | Face recognition locked out | Password fallback |
95 | Pattern unlock canceled | Password fallback |
4 | Invalid arguments | Validate parameters |
17 | Service not supported | Fallback to password |
52 | HTTP connection failure | Retry operation |
Updated 3 months ago