onUserLoggedIn
📲 onUserLoggedIn
Event
onUserLoggedIn
Event🧩 Overview
The onUserLoggedIn
event indicates that the user has successfully completed login via REL-ID, and a secure session has been created. This includes:
- User authentication success (biometrics, password, OTP, etc.)
- Device checks passed
- JWT token issued
- Session ID generated
🔒 This is a critical event used to transition into an authenticated app state.
🖼️ UI Requirement
App developers must:
- Present a welcome screen, main dashboard, or select-group UI (for agent-based login).
- Optionally extract and securely store
userID
,sessionID
, and JWT for subsequent API usage.
🔗 Related APIs (Leading to This Event)
setPassword
setUserConsentForLDA
performVerifyAuth
activateUsing
setActivationCode
These API calls are typically invoked during:
- Activation
- Login
- Additional device registration
🔔 Automatically Triggered SDK Events After Login
Event | Description |
---|---|
onCredentialsAvailableForUpdate | Indicates credentials (e.g. password, secret questions) that the user may update |
onUserEnrollmentResponse (if relevant) | Confirms enrollment if applicable |
Any pending post-login API response events | E.g. onGetNotifications , etc. |
🧪 Sample Payload
{
"userID": "testuser",
"challengeResponse": {
"status": {
"statusCode": 100,
"statusMessage": "Success"
},
"session": {
"sessionType": 1,
"sessionID": "PBWFI2BFK9EH4YWEKXB7Z4VOVR7I7PF1CD5F067IXXFJCUMV..."
},
"additionalInfo": {
"DNAProxyPort": 65535,
"isAdUser": 0,
"jwtJsonTokenInfo": "{\"access_token\":\"<JWT_TOKEN>\"}"
}
},
"error": {
"shortErrorCode": 0,
"errorString": "Success"
}
}
📦 Field Breakdown
Field | Type | Description |
---|---|---|
userID | string | ID of the user who logged in |
challengeResponse.status.statusCode | int | 100 for success |
session.sessionID | string | Token identifying session |
additionalInfo.jwtJsonTokenInfo | string (JSON) | JWT access token details |
DNAProxyPort | int | Local port for DNA proxy, if applicable |
error.shortErrorCode | int | 0 = success; see error handling for others |
❗ Error Codes & Developer Actions
Error Code | Meaning | Developer Action |
---|---|---|
0 | Success | Show success screen, proceed |
88 | SDK already initialized | Terminate & reinitialize |
116 | Invalid user configuration | Show error, contact admin |
126 | User is inactive | Guide user to reactivate |
127 | User is blocked | Block access, suggest contacting admin |
✅ Developer Responsibilities
On Success | On Failure |
---|---|
Cache session ID & JWT (securely) | Display user-friendly error |
Navigate to home or main dashboard | Retry login if recoverable |
If agent-based login, prompt group selection | Block or redirect user if locked |
💻 Code Snippets (Platform-Specific)
🔹 React Native
let onUserLoggedInSubscription = rdnaEventRegistery.addListener(
'onUserLoggedIn',
this.onUserLoggedIn.bind(this)
);
🔹 Flutter
rdnaClient.on(RdnaClient.onUserLoggedIn, onUserLoggedIn);
void onUserLoggedIn(RDNAUserLoggedIn response) {
// Handle session start
}
🔹 Cordova
document.addEventListener('onUserLoggedIn', function(response) {
console.log('User session:', response);
});
🔹 Native Android
@Override
public void onUserLoggedIn(RDNA.RDNAUserLoggedIn response) {
String jwt = response.challengeResponse.additionalInfo.jwtJsonTokenInfo;
// Proceed with session
}
🔹 Native iOS
- (void)onUserLoggedIn:(RDNAUserLoggedIn *)response {
NSString *sessionID = response.challengeResponse.session.sessionID;
// Navigate to app dashboard
}
Updated 3 months ago