getUser
👤 REL-ID SDK Event: getUser
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
- SDK initializes.
- SDK invokes the
getUser
event. - App receives the event and must display a login/username input screen.
- User provides a
userID
. - App sends it back using
setUser(userID)
. - SDK validates and triggers the next event (e.g.,
getActivationCode
,getPassword
, orgetUserConsentForLDA
).
💡 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
Field | Description |
---|---|
recentLoggedInUser | Last known user to have logged in |
rememberedUsers | Array of usernames cached for this device |
challengeResponse.status | Status of the current step (code/message) |
challengeResponse.session | Info about current SDK session |
challengeInfo | SDK challenge configuration for login flow |
error | Any 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
Platform | Syntax | Return Type |
---|---|---|
React Native | RdnaClient.setUser(userId, (syncResponse) => {}) | Callback with error/success JSON |
Flutter | rdnaClient.setUser(<userId as String>); | Error/Success response |
Cordova | RdnaClient.setUser(successCallback, errorCallback, [userId]) | Callback response |
Native iOS | (RDNAError *)setUser:(NSString *)userName; | RDNAError object |
Native Android | RDNA.RDNAError setUser(String userID); | RDNAError object |
📥 Parameters
Parameter | Type | Required | Description |
---|---|---|---|
userId | String | ✅ | Unique 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 Code | Error Enum | Description |
---|---|---|
116 | RDNA_ERR_CIS_CONFIGURATION_INVALID | Invalid user authentication configuration on the server. Contact the admin. |
131 | RDNA_ERR_STEPUP_AUTH_LDA_BIOMETRIC_CANCELLED_BY_USER | Fingerprint authentication cancelled by user. Notification update failed. |
132 | RDNA_ERR_STEPUP_AUTH_LDA_BIOMETRIC_CANCELLED_BY_SYSTEM | Fingerprint authentication cancelled by the system. Notification update failed. |
184 | RDNA_ERR_GENERIC_STEPUP_AUTH_LDA_BIO_FINGERPRINT_CANCELLED_BY_USER | Fingerprint authentication cancelled by user. Unable to verify user identity. |
185 | RDNA_ERR_GENERIC_STEPUP_AUTH_LDA_BIO_FINGERPRINT_CANCELLED_BY_SYSTEM | Fingerprint authentication cancelled by the system. Unable to verify user identity. |
217 | RDNA_ERR_LDA_CONSENT_REJECTED_BY_USER | User denied consent to use fingerprint or face recognition. |
404 | RDNA_ERR_ENABLED_LDA_NOT_FOUND_ON_DEVICE | No biometrics enrolled. User activated using biometric only, or biometrics were removed. Ask user to re-enroll biometrics. |
410 | RDNA_ERR_ACCOUNT_RECOVERY_SESSION_TERMINATED | Treat as success. Show an informational message to the user. |
411 | RDNA_ERR_PASSWORD_UPDATE_SESSION_TERMINATED | Treat as success. Show an informational message to the user. |
412 | RDNA_ERR_DEVICE_DOES_NOT_HAVE_SECURE_STORAGE | Show error indicating device does not support secure storage. |
📘 Status Codes Related to getUser
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 |
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. |
|
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
andchallengeResponse.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().
Updated 2 months ago