Password

Overview

The password challenge in the REL-ID SDK is one of the core authentication mechanisms. It is invoked when the user must either:

🔐 Authenticate using an existing password (e.g., during login), or

🆕 Set a new password (e.g., during activation or password change flow)


🧩 What is the Password Challenge?

The password challenge is a request from the SDK to the host app to:

  1. Display a password prompt to the user.
  2. Enforce password rules (if provided).
  3. Submit the user’s input securely using the appropriate SDK method.

It is triggered via the getPassword event.


🔄 When Is It Triggered?

ScenarioDescription
First-time activationSet a password for new users
LoginValidate an existing password
Password change flowServer instructs user to change password
Fallback authenticationUsed as a secondary or backup method

💼 Why It Matters

Password authentication remains a foundational method for verifying identity. With REL-ID’s implementation:

  • Security is enforced through configurable policies (length, complexity, repetition).
  • The experience is standardized across platforms.
  • Developers are in control of UI rendering, while the SDK manages validation logic and flow.

🧠 What the App Must Do

When the password authentication method is triggered by the SDK, the app must:

  1. Listen for the getPassword event
  2. Prompt the user to enter a password
  3. Validate it based on the password policy provided
  4. Submit it using setPassword()

getPassword Event

📥 Sample Payload – getPassword


{
  "userID": "testuser",
  "challengeMode": 1,
  "attemptsLeft": 3,
  "challengeResponse": {
    "status": {
      "statusCode": 100,
      "statusMessage": "Success"
    },
    "session": {
      "sessionType": 0,
      "sessionID": "1JKMQMQO1X0G9ENL..."
    },
    "additionalInfo": {
      "currentWorkFlow": "FirstTimeUserActivation"
    },
    "challengeInfo": [
      { "key": "Response label", "value": "Password" },
      { "key": "description", "value": "Enter your account password" },
      { "key": "PASSWORD_POLICY", "value": "{{\"minL\": 8,\"maxL\": 16,\"minLc\": 1,\"minDg\":
1,\"minUc\": 1,\"minSc\": 1,\"Repetition\": 2,\"UserIDcheck\":
\"true\",\"msg\": \"Password must contain 8-16 characters, including
atleast 1 uppercase, 1 lowercase, 1 number and special characters\"}}" },
      { "key": "SDK_CHLNG", "value": "YES" },
      { "key": "SDK_CHLNG_MODE", "value": "AUTO" }
    ]
  },
  "error": {
    "shortErrorCode": 0,
    "longErrorCode": 0,
    "errorString": "Success"
  }
}


🧾 Top-Level Fields

FieldDescription
userIDUnique identifier for the user being challenged
challengeModeChallenge handling mode (e.g., AUTO = SDK, MANUAL = App)
attemptsLeftNumber of password attempts remaining

🔁 challengeResponse

FieldDescription
status.statusCode100 indicates success, other codes for failure
status.statusMessageDescriptive status string
session.sessionTypeType of session (typically 0 for app session)
session.sessionIDUnique session identifier

📘 additionalInfo

FieldDescription
currentWorkFlowIndicates the current user workflow (e.g., onboarding)

📚 challengeInfo[] (Key-Value UI Hints)

KeyDescription
Response labelLabel for password input field
descriptionText instructions for the user
PASSWORD_POLICYJSON-encoded string for password complexity rules
SDK_CHLNG"YES" = SDK handles UI; "NO" = app should render
SDK_CHLNG_MODE"AUTO" or "MANUAL" to determine handling strategy
IS_USER_PASSOptional; "true" means this is a user password validation challenge

🚫 error

FieldDescription
shortErrorCodeBrief numeric code to identify error
longErrorCodeExtended error code used internally
errorStringMessage describing the error or status

🔐 Password Policy Structure

{
  "minL": 8,
  "maxL": 16,
  "minLc": 1,
  "minDg": 1,
  "minUc": 1,
  "minSc": 1,
  "Repetition": 2,
  "UserIDcheck": "true"
}
FieldDescription
minLMinimum length
maxLMaximum length
minLcMinimum lowercase letters
minUcMinimum uppercase letters
minDgMinimum digits
minScMinimum special characters
RepetitionMax consecutive character repetition
UserIDcheckWhether password must not include userID

📤 Submitting the Password - setPassword API

The setPassword API is used in the REL-ID SDK to submit a password entered by the user in response to the getPassword event. This may be for authentication or first-time password setup.


🧭 When to Use

  • In response to a getPassword SDK event
  • When the user must enter a password as part of the login or onboarding flow
  • NOT used for changing passwords (use updatePassword for that)

🧪 Sample Code

💙 React Native
RdnaClient.setPassword("MySecure@123", 1, (response) => {
  console.log("Password submitted", response);
});
🟣 Flutter
rdnaClient.setPassword(["MySecure@123", 1]);
🧩 Cordova
com.uniken.rdnaplugin.RdnaClient.setPassword(
  () => console.log("Success"),
  (err) => console.error("Error", err),
  ["MySecure@123", 1]
);
🍏 iOS (Objective-C)
[rdnaInstance setPassword:@"MySecure@123" challengeMode:1];
🤖 Android (Java)
rdna.setPassword("MySecure@123", RDNAChallengeOpMode.MANUAL);

✅ What Happens If Password Is Correct?

  • status.statusCode = 100
  • error.shortErrorCode = 0
  • The password challenge is completed successfully.
  • The SDK moves to the next event in the workflow or completes the session.

❌ Error Handling - Error Codes for getPassword

Error CodeDescription
140Password policy misconfiguration or JSON parsing failed
141Password does not meet the policy
153Attempts exhausted

🔐 Status Codes for getPassword

Status CodeDescriptionSuggested Action
102Invalid Password provided. Please try again.Show an error message with an OK option.
164Password reuse violation. Must enter a new password not used in the last LAST_PASSWORDS passwords.Show message with OK option and prompt user to enter a new password.

❌ What Happens If Password Is Incorrect?

  • status.statusCode = 102
  • The SDK re-triggers getPassword if attemptsLeft > 0
  • You should show an error and prompt the user again

🔒 What Happens If Attempts Are Exhausted?

  • error.shortErrorCode = 153
  • The challenge fails and the SDK determines the next step:
    • Could be fallback authentication
    • Could end the session

🧠 Developer Tips

  • Parse and use PASSWORD_POLICY to validate input on the client side.
  • Always display the description and attemptsLeft.
  • Handle success and error cases cleanly.
  • Wait for SDK callbacks to move to the next challenge — do not hardcode flow transitions.
  • UsesetPassword() for both verification and setting password in first-time activation (Mode 1).
  • UseupdatePassword() for password changes post-login (Mode 2 or 4).
  • Always validate inputs against password policy rules when challengeMode is 1, 2, or 4.



🧪 Sample Code Check

// Pseudocode logic
if ([0, 1, 3, 5, 12, 14].includes(challengeMode)) {
    setPassword(userInputPassword);
} else if ([2, 4].includes(challengeMode)) {
    updatePassword(oldPassword, newPassword);
}


📘 Additional Error Codes Related to getPassword

Error CodeError EnumDescription
89RDNA_LDA_BIOMETRIC_CANCELLED_BY_USERBiometric authentication cancelled by user.
90RDNA_LDA_BIOMETRIC_CANCELLED_BY_SYSTEMBiometric authentication cancelled by system.
91RDNA_LDA_BIOMETRIC_LOCKED_OUTToo many biometric failures; biometric authentication is locked.
92RDNA_LDA_BIO_FACERECOGNITION_CANCELLED_BY_USERFace recognition cancelled by user.
93RDNA_ERR_LDA_BIO_FACERECOGNITION_CANCELLED_BY_SYSTEMFace recognition cancelled by system.
94RDNA_LDA_BIO_FACERECOGNITION_LOCKED_OUTToo many face recognition failures; system has locked the feature.
95RDNA_LDA_PATTERN_CANCELLED_BY_USERPattern authentication cancelled by user.
196RDNA_ERR_LDA_BIO_AUTHENTICATION_CANCELLED_BY_APPLICATIONBiometric authentication cancelled by application.
197RDNA_ERR_LDA_BIO_AUTHENTICATION_CONTEXT_INVALIDATEDAuthentication context invalidated.
198RDNA_ERR_LDA_BIO_AUTHENTICATION_FAILED_BY_APPLE_WATCHAuthentication failed by Apple Watch.
199RDNA_ERR_LDA_BIO_AUTHENTICATION_NON_INTERACTIVE_USERINTERFACE_FORBIDDENNon-interactive UI not allowed during authentication.
200RDNA_ERR_LDA_BIO_AUTHENTICATION_ERROR_UNKNOWNUnknown authentication error.
201RDNA_ERR_LDA_BIO_AUTHENTICATION_NO_FALLBACK_AVAILABLENo fallback authentication available.
202RDNA_ERR_LDA_PASSCODE_NOT_SETDevice passcode is not set.
203RDNA_ERR_LDA_BIO_AUTHENTICATION_NOT_SUPPORTEDBiometric authentication is not supported.
204RDNA_ERR_LDA_BIO_AUTHENTICATION_BIOMETRY_NOT_ENROLLEDBiometric authentication not enrolled.
405RDNA_ERR_FALLBACK_TO_PASSWORD_LDA_NOT_AVAILABLEFallback to password not available for LDA.

ℹ️ Developer Note:
For all the above error codes:

  • If SDK Mode is REL_ID_MANUAL_LDA and RDNAChallengeOpMode is RDNA_CHALLENGE_OP_VERIFY(0):
    • Show error with OK button
    • On OK click → Navigate to password verification screen
  • If SDK Mode is AUTO and RDNAChallengeOpMode is RDNA_CHALLENGE_OP_SET(1):
    • Show error with OK button
    • On OK click → Navigate to set password screen

📌 Additional Developer Note (For RDNA_ERR_ENABLED_LDA_NOT_FOUND_ON_DEVICE):
This error is triggered in login flow under the following scenarios:

  1. User is activated using device biometric only, and no manual password is set.
  2. The prerequisite ACTIVATE_USING_PASS_MANDATORY is configured to FALSE. The user is activated using manual password. Later, biometric authentication is enabled using LDA toggling. During the next login, if all the device biometrics are removed:

👉 Action: Ask user to enroll at least one biometric on the device and try again.