onAuthenticationOptionsAvailable
š REL-ID SDK Event: onAuthenticationOptionsAvailable
onAuthenticationOptionsAvailableš§ Overview
The onAuthenticationOptionsAvailable event is triggered during the login process when the SDK needs to notify the app about the available authentication mechanisms for the user. This may include:
- REL-ID Password
- Device-based LDA (e.g., fingerprint, face, pattern)
- Other configured options
š Purpose
- Allow the app to present available authentication options dynamically.
- Enable the user to choose between options like Password and DeviceLDA.
- Smoothly switch between password and biometric methods.
š When Itās Triggered
- During login, once the session is initialized and options are determined.
- When user is eligible for both LDA and password.
- Will not trigger if only one method is configured (app will go straight to that challenge).
š¦ Sample Payload
{
"userID": "test",
"authenticationOptions": ["Password", "DeviceLDA"],
"challengeMode": 0,
"challengeResponse": {
"status": {
"statusCode": 100,
"statusMessage": "Success."
},
"session": {
"sessionType": 0,
"sessionID": "XYZ123SESSIONID"
},
"additionalInfo": {
"DNAProxyPort": 0,
"isAdUser": 0,
"JWT": "",
"idvUserRole": "USER",
"currentWorkFlow": "NormalLogin"
},
"challengeInfo": [
{ "key": "Response label", "value": "Password" },
{ "key": "SDK_CHLNG", "value": "YES" },
{ "key": "SDK_CHLNG_MODE", "value": "AUTO" },
{ "key": "ENABLE_FORGOT_PASSWORD", "value": "true" },
{ "key": "RELID_PASSWORD_POLICY", "value": "{...}" }
]
},
"error": {
"longErrorCode": 0,
"shortErrorCode": 0,
"errorString": "Success"
}
}š§ Fields
| Field | Description |
|---|---|
userID | ID of the logging-in user |
authenticationOptions | List of available methods: "Password", "DeviceLDA", etc. |
challengeMode | Indicates type of challenge mode configured |
challengeResponse | Status, session, and challenge info from the server |
error | SDK-level success/failure info |
š» Platform Usage
React Native
rdnaEventRegistery.addListener('onAuthenticationOptionsAvailable', (event) => {
console.log(event.authenticationOptions);
// App should render the UI for options
});Flutter
rdna.on(RdnaClient.onAuthenticationOptionsAvailable, (options) {
print("Options: $options");
});Cordova
document.addEventListener('onAuthenticationOptionsAvailable', function(e) {
console.log(e.authenticationOptions);
});ā
Developer Action
- The app will call the
authenticateUsingAPI to initiate authentication by passing one of the options from theauthenticationOptionsavailable in the payload.
š REL-ID SDK API: authenticateUsing
authenticateUsingš§ Overview
The authenticateUsing API is used to initiate user authentication with a specific method (e.g., Password, Local Device Authentication) selected from the options provided by the SDK via onAuthenticationOptionsAvailable.
š Purpose
- Authenticate a user using a method like LDA, Face ID, Pattern, or Password.
- Complete login or trigger challenge-based verification flow.
š When to Use
- After receiving the
onAuthenticationOptionsAvailableevent. - Once the user chooses an authentication method (e.g., Password, DEVICE_LDA).
- Before continuing to next steps like session setup or secure access.
š§¾ Parameters
| Parameter | Type | Description |
|---|---|---|
selectedAuthenticationOption | String | Authentication method chosen (e.g., "PASSWORD", "DEVICE_LDA") |
challengeMode | Enum | Challenge operation mode (e.g., AUTO, SEMIAUTO) as RDNAChallengeOpMode |
š” Example Usage
React Native
RdnaClient.authenticateUsing("PASSWORD", "AUTO", (syncResponse) => {
console.log("Auth response:", syncResponse);
});Flutter
await rdnaClient.authenticateUsing("DEVICE_LDA", RDNAChallengeOpMode.AUTO);Cordova
com.uniken.rdnaplugin.RdnaClient.authenticateUsing(
successCallback,
errorCallback,
["PASSWORD", "AUTO"]
);Native iOS
[client authenticateUsing:@"DEVICE_LDA" challengeMode:RDNAChallengeOpModeAuto];Native Android
RDNAError result = rdnaClient.authenticateUsing("PASSWORD", RDNAChallengeOpMode.AUTO);ā ļø Error Codes
Code | Error Enum | Description |
|---|---|---|
413 | RDNA_ERR_AUTHENTICATION_OPTION_CHO SEN_NOT_SUPPORTED | SDK API AuthenticateUsing will return this error code (in sync) if the provided authenticator string is invalid and does not match any of the strings provided in the callback āonAuthenticationOptionsAvailableā. |
ā
On Success
- Authentication proceeds and session is established.
- SDK may emit session-related events or continue login flow.
ā On Failure
- App should fallback to password or allow retry.
Updated 9 months ago
