getUser

👤 REL-ID SDK Event: getUser

The getUser event is triggered by the REL-ID SDK during the initialization process or login/activation workflows. It indicates that the SDK requires a username to proceed.


📌 Purpose

To prompt the application to provide the userID that will be authenticated or onboarded. The application must respond by invoking the setUser(<USERNAME>) API.


🔄 Workflow

  1. SDK initializes.
  2. SDK invokes the getUser event.
  3. App receives the event and must display a login/username input screen.
  4. User provides a userID.
  5. App sends it back using setUser(userID).
  6. SDK validates and triggers the next event (e.g., getActivationCode, getPassword, or getUserConsentForLDA).

💡 Sample Response Payload

Click to expand the sample payload
{
"recentLoggedInUser": "testuser",
"rememberedUsers": ["testuser"],
"challengeResponse": {
  "status": {
    "statusCode": 100,
    "statusMessage": ""
  },
  "session": {
    "sessionType": 0,
    "sessionID": "ABC123XYZ456"
  },
  "additionalInfo": {
    "currentWorkFlow": "Activation",
    "isAdUser": 0,
    "JWT": "",
    "loginIDs": [],
    "availableGroups": []
  },
  "challengeInfo": [
    { "key": "SDK_CHLNG", "value": "YES" },
    { "key": "SDK_CHLNG_MODE", "value": "AUTO" },
    { "key": "AUTH_TYPE", "value": "REL_ID_PASSWORDLESS" },
    { "key": "ENABLE_FORGOT_LID", "value": "TRUE" }
  ]
},
"error": {
  "longErrorCode": 0,
  "shortErrorCode": 0,
  "errorString": "Success"
}
}

📋 Key Fields

FieldDescription
recentLoggedInUserLast known user to have logged in
rememberedUsersArray of usernames cached for this device
challengeResponse.statusStatus of the current step (code/message)
challengeResponse.sessionInfo about current SDK session
challengeInfoSDK challenge configuration for login flow
errorAny error metadata from the SDK

👤 setUser API

📘 Description

The setUser API is used to submit the user ID to the REL-ID SDK. This API must be called in response to thegetUser event, which is triggered during login or activation flows.

It informs the SDK which user is attempting to authenticate or activate, and enables the SDK to proceed with the next challenge (e.g., activation code, biometric, password).


🧑‍💻 Platform Support

PlatformSyntaxReturn Type
React NativeRdnaClient.setUser(userId, (syncResponse) => {})Callback with error/success JSON
FlutterrdnaClient.setUser(<userId as String>);Error/Success response
CordovaRdnaClient.setUser(successCallback, errorCallback, [userId])Callback response
Native iOS(RDNAError *)setUser:(NSString *)userName;RDNAError object
Native AndroidRDNA.RDNAError setUser(String userID);RDNAError object

📥 Parameters

ParameterTypeRequiredDescription
userIdStringUnique identifier of the user


📱 Platform-Specific Integration

React Native
// Listener setup
let getUserSubscription = rdnaEventRegistery.addListener('getUser', (event) => {
  console.log("getUser event received");
  const userId = "testuser"; // get from UI input
  RdnaClient.setUser(userId);
});
Flutter
// Event binding
rdnaClient.on(RdnaClient.getUser, (response) {
  print("getUser event triggered");
  String userId = "testuser"; // from UI
  rdnaClient.setUser(userId);
});
Cordova
document.addEventListener("getUser", function(event) {
  console.log("getUser event received");
  var userId = "testuser"; // from UI
  com.uniken.rdnaplugin.RdnaClient.setUser(
    () => console.log("setUser success"),
    (err) => console.error("setUser error", err),
    [userId]
  );
}, false);
iOS (Objective-C)
// getUser event handler
- (void)getUser {
  NSLog(@"getUser triggered");
  NSString *userId = @"testuser"; // from user input
  [rdnaInstance setUser:userId];
}
Android (Java)
@Override
public void getUser() {
  Log.d("REL-ID", "getUser triggered");
  String userId = "testuser"; // obtain from UI
  rdna.setUser(userId);
}

⚠️ Error Handling

Before proceeding, always validate:

if (response.error.shortErrorCode === 0 &&
    response.challengeResponse.status.statusCode === 100) {
    // safe to proceed with setUser
}


❌ Error Codes

Error CodeError EnumDescription
116RDNA_ERR_CIS_CONFIGURATION_INVALIDInvalid user authentication configuration on the server. Contact the admin.
131RDNA_ERR_STEPUP_AUTH_LDA_BIOMETRIC_CANCELLED_BY_USERFingerprint authentication cancelled by user. Notification update failed.
132RDNA_ERR_STEPUP_AUTH_LDA_BIOMETRIC_CANCELLED_BY_SYSTEMFingerprint authentication cancelled by the system. Notification update failed.
184RDNA_ERR_GENERIC_STEPUP_AUTH_LDA_BIO_FINGERPRINT_CANCELLED_BY_USERFingerprint authentication cancelled by user. Unable to verify user identity.
185RDNA_ERR_GENERIC_STEPUP_AUTH_LDA_BIO_FINGERPRINT_CANCELLED_BY_SYSTEMFingerprint authentication cancelled by the system. Unable to verify user identity.
217RDNA_ERR_LDA_CONSENT_REJECTED_BY_USERUser denied consent to use fingerprint or face recognition.
404RDNA_ERR_ENABLED_LDA_NOT_FOUND_ON_DEVICENo biometrics enrolled. User activated using biometric only, or biometrics were removed. Ask user to re-enroll biometrics.
410RDNA_ERR_ACCOUNT_RECOVERY_SESSION_TERMINATEDTreat as success. Show an informational message to the user.
411RDNA_ERR_PASSWORD_UPDATE_SESSION_TERMINATEDTreat as success. Show an informational message to the user.
412RDNA_ERR_DEVICE_DOES_NOT_HAVE_SECURE_STORAGEShow error indicating device does not support secure storage.

📘 Status Codes Related to getUser

Status Code

Description

Action

101

No such user exists.

Show message with OK option and suggest user to verify the username or signup.

105

Updating password failed / User does not exist

Show message with OK option.

116

User does not exist

Show message with OK option.

120

Device limit exceeded.

Show message with OK option.

126

The user is inactive. Please login from a previously registered device or contact support.

Show message with OK option.

127

The user is blocked. Kindly contact the admin to unblock the user.

Show message with OK option.

133

New device activation is rejected.

Show message with OK option.

141

Your user/device is blocked, would you like to proceed?

Show error dialog with OK and CANCEL options. Invoke resetBlockedUserAccount() API on OK.

138

User Device is blocked. Kindly contact the admin. [During activation with all attempts exhausted]

Reset the user from GM.

152

Cannot generate random activation code. Configuration is disabled.

  1. Enterprise to invoke /setPredefinedCode.htm on REL-ID server
    2. App calls setUser which triggers getActivationCode.

143

The user is deleted. Kindly contact the admin.

Show message with OK option.

147

The user is inactive. Kindly contact the admin.

Show message with OK option.

148

User Device is inactive. Kindly contact the admin.

Show message with OK option.

149

Forgot password attempts exhausted. Kindly contact the admin.

Show message with OK option.

154

You are not authorized to use this app. Please contact the admin.

Show message with OK option.

158

Account Recovery disallowed in additional device activation.

Show message with OK option.

159

Account Recovery disallowed from same device.

Show message with OK option.

160

Account Recovery disallowed for invalid user status.

Show message with OK option.

161

Account Recovery disallowed for blocked device status.

Show message with OK option.

162

Account Recovery disallowed for inactive device status.

Show message with OK option.

166

User is locked. Please try again after REMAINING_TIME.

Show a pop-up with error message and prevent login until cooling period ends.

167

User needs to login to initiate device activation.

Show message with OK option.


✅ Next Steps After setUser

Once setUser(userID) is called:

  • If the user is new or reset, SDK may call:

    • getActivationCode
    • getEmailOTP
    • onHandleCustomChallenge
  • If user is recognized:

    • getPassword
    • getUserConsentForLDA
    • onUserLoggedIn (if biometrics used)

📎 Key Integration Tips

  • Use rememberedUsers list to pre-fill login suggestions.
  • Always check both error.shortErrorCode and challengeResponse.status.statusCode before proceeding.
  • Handle errors like user not found, already logged in, invalid status.
  • Let the SDK drive the flow — it will tell you what comes after setUser().