Get User Consent For LDA

Overview of 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

FieldDescription
userIDID of the user
challengeModeMode of operation (Auto / Manual)
authenticationTypeType of authentication requested
challengeInfoOptional additional challenge info
errorStandard error object if any


πŸ“± User Consent for LDA - Screen Design on Receiving 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

SectionDescription
TitleEnable Device Authentication
Message / DescriptionA 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 IconsBased 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)

authenticationTypeWhat to Show on Screen
1 - FingerprintShow fingerprint icon and message "Use your fingerprint for secure login?"
2 - FaceIDShow FaceID icon and message "Use FaceID for authentication?"
3 - PatternShow a pattern unlock graphic
8 - PasscodeShow PIN/keypad graphic and PIN entry messaging
10 - Best Available BiometricDynamically 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

ParameterTypeDescription
consentbooleantrue if the user agrees to enable LDA, false if declined
challengeModenumberChallenge mode received from the getUserConsentForLDA event
authenticationTypenumberAuthentication 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 trigger getPassword event. If LDA is mandated in the Gateway manager, then the SDK will fail the challenge and call getUser 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

{
  "userID": "[email protected]",
  "challengeMode": 1,
  "authenticationType": 2,
  "challengeInfo": [],
  "error": {
    "longErrorCode": 0,
    "shortErrorCode": 0,
    "errorString": "Success"
  }
}

8. Error Codes and Actions - validate

Error CodeMeaningAction
89User canceled biometricShow password fallback
90System canceled biometricRetry or fallback
91Biometric locked outPassword fallback
92Face recognition canceledRetry or fallback
93Face recognition canceled by systemRetry or fallback
94Face recognition locked outPassword fallback
95Pattern unlock canceledPassword fallback
4Invalid argumentsValidate parameters
17Service not supportedFallback to password
52HTTP connection failureRetry operation